<?php
/**
 * elina-lite-portfolio-gallery Theme Customizer
 *
 * @package elina-lite-portfolio-gallery
 */

/**
 * Add postMessage support for site title and description for the Theme Customizer.
 *
 * @param WP_Customize_Manager $wp_customize Theme Customizer object.
 */
function elinalite_customize_register( $wp_customize ) {
	$wp_customize->get_setting( 'blogname' )->transport         = 'postMessage';
	$wp_customize->get_setting( 'blogdescription' )->transport  = 'postMessage';
	$wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage';

	if ( isset( $wp_customize->selective_refresh ) ) {
		$wp_customize->selective_refresh->add_partial(
			'blogname',
			array(
				'selector'        => '.site-title a',
				'render_callback' => 'elinalite_customize_partial_blogname',
			)
		);
		$wp_customize->selective_refresh->add_partial(
			'blogdescription',
			array(
				'selector'        => '.site-description',
				'render_callback' => 'elinalite_customize_partial_blogdescription',
			)
		);
	}

	/**
     * Sanitization Functions
     * 
     * @link https://github.com/WPTRT/code-examples/blob/master/customizer/sanitization-callbacks.php 
    */ 
	/** Radio Sanitize */
function elinalite_sanitize_radio( $input, $setting ) {
    // Ensure input is a slug.
    $input = sanitize_key( $input );
    // Get list of choices from the control associated with the setting.
    $choices = $setting->manager->get_control( $setting->id )->choices;
    // If the input is a valid key, return it; otherwise, return the default.
    return ( array_key_exists( $input, $choices ) ? $input : $setting->default );
}  

}
add_action( 'customize_register', 'elinalite_customize_register' );

/**
 * Render the site title for the selective refresh partial.
 *
 * @return void
 */
function elinalite_customize_partial_blogname() {
	bloginfo( 'name' );
}

/**
 * Render the site tagline for the selective refresh partial.
 *
 * @return void
 */
function elinalite_customize_partial_blogdescription() {
	bloginfo( 'description' );
}

/**
 * Binds JS handlers to make Theme Customizer preview reload changes asynchronously.
 */
function elinalite_customize_preview_js() {
	wp_enqueue_script( 'elinalite-customizer', get_template_directory_uri() . '/js/customizer.js', array( 'customize-preview' ), ELINALITE_VERSION, true );
}
add_action( 'customize_preview_init', 'elinalite_customize_preview_js' );

/**
 * PRO PAGE

 */

require get_template_directory() . '/inc/go-pro/class-customize.php';


/*-----------------------------------------------------------------------------------*/
/*	Customizer
/*-----------------------------------------------------------------------------------*/

/*-----------------------------------------------------------------------------------*/
/*	Theme Info 
/*-----------------------------------------------------------------------------------*/

function my_customize_register($wp_customize) {

	$wp_customize->add_section( 'theme_info', array(
		'title'       => __( 'Demo & Documentation', 'elina-lite-portfolio-gallery' ),
		'priority'    => 6,
	) );
	
	/** Important Links */
	$wp_customize->add_setting( 'theme_info_theme',
		array(
			'default' => '',
			'sanitize_callback' => 'wp_kses_post',
		)
	);

	$theme_info = '';
	$theme_info .= sprintf( '<p>' . __( 'Pro Demo Link: %1$sClick here.%2$s', 'elina-lite-portfolio-gallery' ) . '</p>', '<a href="' . esc_url( 'https://pixelonetry.com/previews/?theme=elina' ) . '" target="_blank">', '</a>' );
	//$theme_info .= sprintf( '<p>' . __( 'Pro Dark Demo Link: %1$sClick here.%2$s', 'elina-lite-portfolio-gallery' ) . '</p>', '<a href="' . esc_url( 'https://demo.pixelonetry.com/elina-dark/' ) . '" target="_blank">', '</a>' );
	$theme_info .= sprintf( '<p>' . __( 'Documentation Link: %1$sClick here.%2$s', 'elina-lite-portfolio-gallery' ) . '</p>', '<a href="' . esc_url( 'https://pixelonetry.com/docs/elina-lite/' ) . '" target="_blank">', '</a>' );
	$theme_info .= sprintf( '<p>' . __( 'Submit Ticket: %1$sClick here.%2$s', 'elina-lite-portfolio-gallery' ) . '</p>', '<a href="' . esc_url( 'https://support.pixelonetry.com/' ) . '" target="_blank">', '</a>' );
	$theme_info .= sprintf( '<p>' . __( 'Rate This Theme: %1$sClick here.%2$s', 'elina-lite-portfolio-gallery' ) . '</p>', '<a href="' . esc_url( 'https://wordpress.org/support/theme/elina-lite-portfolio-gallery/reviews/#new-post' ) . '" target="_blank">', '</a>' );

	$wp_customize->add_control( new WP_Customize_Control( $wp_customize,
		'theme_info_theme',
		array(
			'section'     => 'theme_info',
			'description' => $theme_info,
			'type'        => 'hidden', // Optional, can hide the control input
		)
	));
	
	/*-----------------------------------------------------------------------------------*/
    /*	Galleries 
    /*-----------------------------------------------------------------------------------*/

    // Add a new panel
    $wp_customize->add_panel(
        'elinalite-fancybox-gallery', // Panel ID
        array(
            'title'       => __('Fancybox Galleres', 'elina-lite-portfolio-gallery'), // Panel title
            'description' => __('The galleries displaying in your front page header area', 'elina-lite-portfolio-gallery'), // Description
            'priority'    => 30, // Priority determines the order of appearance
        )
    );
	

	$wp_customize->add_setting('elinalite-enable-galleries', array(
		'default'   => true,
		'sanitize_callback' => 'elinalite_sanitize_checkbox',
	));

	$wp_customize->add_control(new WP_Customize_Control(
		$wp_customize,
		'elinalite_checkbox_control',
		array(
			'label'    => __('Enable Galleries', 'elina-lite-portfolio-gallery'),
			'section'  => 'static_front_page', // Use the default 'title_tagline' section
			'settings' => 'elinalite-enable-galleries',
			'type'     => 'checkbox',
		)
	));

	$wp_customize->add_setting('elinalite-disable-post-page', array(
		'default'   => false,
		'sanitize_callback' => 'elinalite_sanitize_checkbox',
	));

	$wp_customize->add_control(new WP_Customize_Control(
		$wp_customize,
		'elinalite_disable_post_page_control',
		array(
			'label'    => __('Show Only Galleries', 'elina-lite-portfolio-gallery'),
			'section'  => 'static_front_page', // Use the default 'title_tagline' section
			'settings' => 'elinalite-disable-post-page',
			'description' => __('If the button is enabled is disabling all features Blog Posts, Pages On Pront Page This way only show the Galleries. ', 'elina-lite-portfolio-gallery'),
			'type'     => 'checkbox',
		)
	));
	

	// Add the first section to the panel
	/*$wp_customize->add_section('elinalite-galleries-settings', array(
		'title'    => __('Galleries Settings', 'elina-lite-portfolio-gallery'),
		'panel'       => 'elinalite-fancybox-gallery', // Assign this section to the panel
		'priority' => 10,
	));*/

	function elinalite_sanitize_checkbox( $checked ) {
		// Boolean check
		return ( isset( $checked ) && true == $checked );
	}
	
    // Add the first section to the panel
    $wp_customize->add_section(
        'gallery1', // Section ID
        array(
            'title'       => __('Gallery 1', 'elina-lite-portfolio-gallery'), // Section title
            'panel'       => 'elinalite-fancybox-gallery', // Assign this section to the panel
            'priority'    => 10,
        )
    );

    // Add the second section to the panel
    $wp_customize->add_section(
        'gallery2', // Section ID
        array(
            'title'       => __('Gallery 2', 'elina-lite-portfolio-gallery'), // Section title
            'panel'       => 'elinalite-fancybox-gallery', // Assign this section to the panel
            'priority'    => 20,
        )
    );
	 // Add the second section to the panel
	 $wp_customize->add_section(
        'gallery3', // Section ID
        array(
            'title'       => __('Gallery 3', 'elina-lite-portfolio-gallery'), // Section title
            'panel'       => 'elinalite-fancybox-gallery', // Assign this section to the panel
            'priority'    => 20,
        )
    );

	 // Add the second section to the panel
	 $wp_customize->add_section(
        'gallery4', // Section ID
        array(
            'title'       => __('Gallery 4', 'elina-lite-portfolio-gallery'), // Section title
            'panel'       => 'elinalite-fancybox-gallery', // Assign this section to the panel
            'priority'    => 20,
        )
    );

	 // Add the second section to the panel
	 $wp_customize->add_section(
        'gallery5', // Section ID
        array(
            'title'       => __('Gallery 5', 'elina-lite-portfolio-gallery'), // Section title
            'panel'       => 'elinalite-fancybox-gallery', // Assign this section to the panel
            'priority'    => 20,
        )
    );

    // Gallery Img 1
    $wp_customize->add_setting(
		'fancyboxg1', // Setting ID
		array(
			//'default'           => '', // No default image
			'default'           => get_template_directory_uri() . '/images/gallery/gal1.jpg', 
			'sanitize_callback' => 'esc_url_raw', // Sanitize to ensure it's a valid URL
		)
	);
	
	$wp_customize->add_control(
		new WP_Customize_Image_Control( // Use the WP_Customize_Image_Control class
			$wp_customize, // Pass the customizer object
		'fancyboxg1', // Control ID
			array(
				'label'    => __( 'Select Image', 'elina-lite-portfolio-gallery' ), // Control label
				'section'  => 'gallery1', // Section where it appears
				//'settings' => 'gallery1', // Link to the setting ID
			)
		)
	);

	// Gallery Img 2
    $wp_customize->add_setting(
		'fancyboxg2', // Setting ID
		array(
			//'default'           => '', // No default image
			'default'           => get_template_directory_uri() . '/images/gallery/gal2.jpg', 
			'sanitize_callback' => 'esc_url_raw', // Sanitize to ensure it's a valid URL
		)
	);
	
	$wp_customize->add_control(
		new WP_Customize_Image_Control( // Use the WP_Customize_Image_Control class
			$wp_customize, // Pass the customizer object
		'fancyboxg2', // Control ID
			array(
				'label'    => __( 'Select Image', 'elina-lite-portfolio-gallery' ), // Control label
				'section'  => 'gallery1', // Section where it appears
				//'settings' => 'gallery1', // Link to the setting ID
			)
		)
	);

	// Gallery Img 3
    $wp_customize->add_setting(
		'fancyboxg3', // Setting ID
		array(
			'default'           => get_template_directory_uri() . '/images/gallery/gal3.jpg', 
			'sanitize_callback' => 'esc_url_raw', // Sanitize to ensure it's a valid URL
		)
	);
	
	$wp_customize->add_control(
		new WP_Customize_Image_Control( // Use the WP_Customize_Image_Control class
			$wp_customize, // Pass the customizer object
		'fancyboxg3', // Control ID
			array(
				'label'    => __( 'Select Image', 'elina-lite-portfolio-gallery' ), // Control label
				'section'  => 'gallery1', // Section where it appears
				//'settings' => 'gallery1', // Link to the setting ID
			)
		)
	);

	// Gallery Img 4
    $wp_customize->add_setting(
		'fancyboxg4', // Setting ID
		array(
			'default'           => get_template_directory_uri() . '/images/gallery/gal4.jpg', 
			'sanitize_callback' => 'esc_url_raw', // Sanitize to ensure it's a valid URL
		)
	);
	
	$wp_customize->add_control(
		new WP_Customize_Image_Control( // Use the WP_Customize_Image_Control class
			$wp_customize, // Pass the customizer object
		'fancyboxg4', // Control ID
			array(
				'label'    => __( 'Select Image', 'elina-lite-portfolio-gallery' ), // Control label
				'section'  => 'gallery1', // Section where it appears
				//'settings' => 'gallery1', // Link to the setting ID
			)
		)
	);

	 /** Note */
	 $wp_customize->add_setting(
		'gal1pro',
		array(
			'default'           => '',
			'sanitize_callback' => 'wp_kses_post' 
		)
	);
	
	$wp_customize->add_control(
		new Elinalite_Note_Control( 
			$wp_customize,
			'gal1pro',
			array(
				'section'     => 'gallery1',
				'description' => sprintf( __( '%1$sUpgrade to Pro use unlimited images.%2$s %3$sUpgrade to Pro%4$s ', 'elina-lite-portfolio-gallery' ),'<div class="pro-version-button"><span>', '</span>', '<a href="https://pixelonetry.com/downloads/elina-creative-one-page-wordpress-theme/" target="_blank">', '</a></div>' ),
			)
		)
	 );		

	// Gallery Img 1
    $wp_customize->add_setting(
		'fancyboxg5', // Setting ID
		array(
			'default'           => get_template_directory_uri() . '/images/gallery/gal5.jpg', 
			'sanitize_callback' => 'esc_url_raw', // Sanitize to ensure it's a valid URL
		)
	);
	
	$wp_customize->add_control(
		new WP_Customize_Image_Control( // Use the WP_Customize_Image_Control class
			$wp_customize, // Pass the customizer object
		'fancyboxg5', // Control ID
			array(
				'label'    => __( 'Select Image', 'elina-lite-portfolio-gallery' ), // Control label
				'section'  => 'gallery2', // Section where it appears
				//'settings' => 'gallery1', // Link to the setting ID
			)
		)
	);

	// Gallery Img 6
    $wp_customize->add_setting(
		'fancyboxg6', // Setting ID
		array(
			'default'           => get_template_directory_uri() . '/images/gallery/gal6.jpg', 
			'sanitize_callback' => 'esc_url_raw', // Sanitize to ensure it's a valid URL
		)
	);
	
	$wp_customize->add_control(
		new WP_Customize_Image_Control( // Use the WP_Customize_Image_Control class
			$wp_customize, // Pass the customizer object
		'fancyboxg6', // Control ID
			array(
				'label'    => __( 'Select Image', 'elina-lite-portfolio-gallery' ), // Control label
				'section'  => 'gallery2', // Section where it appears
				//'settings' => 'gallery1', // Link to the setting ID
			)
		)
	);

	// Gallery Img 7
    $wp_customize->add_setting(
		'fancyboxg7', // Setting ID
		array(
			'default'           => get_template_directory_uri() . '/images/gallery/gal7.jpg', 
			'sanitize_callback' => 'esc_url_raw', // Sanitize to ensure it's a valid URL
		)
	);
	
	$wp_customize->add_control(
		new WP_Customize_Image_Control( // Use the WP_Customize_Image_Control class
			$wp_customize, // Pass the customizer object
		'fancyboxg7', // Control ID
			array(
				'label'    => __( 'Select Image', 'elina-lite-portfolio-gallery' ), // Control label
				'section'  => 'gallery2', // Section where it appears
				//'settings' => 'gallery1', // Link to the setting ID
			)
		)
	);

	// Gallery Img 8
    $wp_customize->add_setting(
		'fancyboxg8', // Setting ID
		array(
			'default'           => get_template_directory_uri() . '/images/gallery/gal8.jpg', 
			'sanitize_callback' => 'esc_url_raw', // Sanitize to ensure it's a valid URL
		)
	);
	
	$wp_customize->add_control(
		new WP_Customize_Image_Control( // Use the WP_Customize_Image_Control class
			$wp_customize, // Pass the customizer object
		'fancyboxg8', // Control ID
			array(
				'label'    => __( 'Select Image', 'elina-lite-portfolio-gallery' ), // Control label
				'section'  => 'gallery2', // Section where it appears
				//'settings' => 'gallery1', // Link to the setting ID
			)
		)
	);

		/** Note */
		$wp_customize->add_setting(
		'gal2pro',
		array(
			'default'           => '',
			'sanitize_callback' => 'wp_kses_post' 
		)
	);

	$wp_customize->add_control(
		new Elinalite_Note_Control( 
			$wp_customize,
			'gal2pro',
			array(
				'section'     => 'gallery2',
				'description' => sprintf( __( '%1$sUpgrade to Pro use unlimited images.%2$s %3$sUpgrade to Pro%4$s ', 'elina-lite-portfolio-gallery' ),'<div class="pro-version-button"><span>', '</span>', '<a href="https://pixelonetry.com/downloads/elina-creative-one-page-wordpress-theme/" target="_blank">', '</a></div>' ),
			)
		)
		);		

	// Gallery Img 9
    $wp_customize->add_setting(
		'fancyboxg9', // Setting ID
		array(
			'default'           => get_template_directory_uri() . '/images/gallery/gal9.jpg', 
			'sanitize_callback' => 'esc_url_raw', // Sanitize to ensure it's a valid URL
		)
	);
	
	$wp_customize->add_control(
		new WP_Customize_Image_Control( // Use the WP_Customize_Image_Control class
			$wp_customize, // Pass the customizer object
		'fancyboxg9', // Control ID
			array(
				'label'    => __( 'Select Image', 'elina-lite-portfolio-gallery' ), // Control label
				'section'  => 'gallery3', // Section where it appears
				//'settings' => 'gallery1', // Link to the setting ID
			)
		)
	);
	// Gallery Img 10
    $wp_customize->add_setting(
		'fancyboxg10', // Setting ID
		array(
			'default'           => get_template_directory_uri() . '/images/gallery/gal10.jpg', 
			'sanitize_callback' => 'esc_url_raw', // Sanitize to ensure it's a valid URL
		)
	);
	
	$wp_customize->add_control(
		new WP_Customize_Image_Control( // Use the WP_Customize_Image_Control class
			$wp_customize, // Pass the customizer object
		'fancyboxg10', // Control ID
			array(
				'label'    => __( 'Select Image', 'elina-lite-portfolio-gallery' ), // Control label
				'section'  => 'gallery3', // Section where it appears
				//'settings' => 'gallery1', // Link to the setting ID
			)
		)
	);
	// Gallery Img 11
    $wp_customize->add_setting(
		'fancyboxg11', // Setting ID
		array(
			'default'           => get_template_directory_uri() . '/images/gallery/gal11.jpg', 
			'sanitize_callback' => 'esc_url_raw', // Sanitize to ensure it's a valid URL
		)
	);
	
	$wp_customize->add_control(
		new WP_Customize_Image_Control( // Use the WP_Customize_Image_Control class
			$wp_customize, // Pass the customizer object
		'fancyboxg11', // Control ID
			array(
				'label'    => __( 'Select Image', 'elina-lite-portfolio-gallery' ), // Control label
				'section'  => 'gallery3', // Section where it appears
				//'settings' => 'gallery1', // Link to the setting ID
			)
		)
	);
	// Gallery Img 12
    $wp_customize->add_setting(
		'fancyboxg12', // Setting ID
		array(
			'default'           => get_template_directory_uri() . '/images/gallery/gal12.jpg', 
			'sanitize_callback' => 'esc_url_raw', // Sanitize to ensure it's a valid URL
		)
	);
	
	$wp_customize->add_control(
		new WP_Customize_Image_Control( // Use the WP_Customize_Image_Control class
			$wp_customize, // Pass the customizer object
		'fancyboxg12', // Control ID
			array(
				'label'    => __( 'Select Image', 'elina-lite-portfolio-gallery' ), // Control label
				'section'  => 'gallery3', // Section where it appears
				//'settings' => 'gallery1', // Link to the setting ID
			)
		)
	);

	/** Note */
	$wp_customize->add_setting(
	'gal3pro',
	array(
		'default'           => '',
		'sanitize_callback' => 'wp_kses_post' 
	)
   );

   $wp_customize->add_control(
	new Elinalite_Note_Control( 
		$wp_customize,
		'gal3pro',
		array(
			'section'     => 'gallery3',
			'description' => sprintf( __( '%1$sUpgrade to Pro use unlimited images.%2$s %3$sUpgrade to Pro%4$s ', 'elina-lite-portfolio-gallery' ),'<div class="pro-version-button"><span>', '</span>', '<a href="https://pixelonetry.com/downloads/elina-creative-one-page-wordpress-theme/" target="_blank">', '</a></div>' ),
		)
	)
);	

	// Gallery Img 13
    $wp_customize->add_setting(
		'fancyboxg13', // Setting ID
		array(
			'default'           => get_template_directory_uri() . '/images/gallery/gal13.jpg', 
			'sanitize_callback' => 'esc_url_raw', // Sanitize to ensure it's a valid URL
		)
	);
	
	$wp_customize->add_control(
		new WP_Customize_Image_Control( // Use the WP_Customize_Image_Control class
			$wp_customize, // Pass the customizer object
		'fancyboxg13', // Control ID
			array(
				'label'    => __( 'Select Image', 'elina-lite-portfolio-gallery' ), // Control label
				'section'  => 'gallery4', // Section where it appears
				//'settings' => 'gallery1', // Link to the setting ID
			)
		)
	);

	// Gallery Img 14
    $wp_customize->add_setting(
		'fancyboxg14', // Setting ID
		array(
			'default'           => get_template_directory_uri() . '/images/gallery/gal14.jpg', 
			'sanitize_callback' => 'esc_url_raw', // Sanitize to ensure it's a valid URL
		)
	);
	
	$wp_customize->add_control(
		new WP_Customize_Image_Control( // Use the WP_Customize_Image_Control class
			$wp_customize, // Pass the customizer object
		'fancyboxg14', // Control ID
			array(
				'label'    => __( 'Select Image', 'elina-lite-portfolio-gallery' ), // Control label
				'section'  => 'gallery4', // Section where it appears
				//'settings' => 'gallery1', // Link to the setting ID
			)
		)
	);

	// Gallery Img 15
    $wp_customize->add_setting(
		'fancyboxg15', // Setting ID
		array(
			'default'           => get_template_directory_uri() . '/images/gallery/gal15.jpg', 
			'sanitize_callback' => 'esc_url_raw', // Sanitize to ensure it's a valid URL
		)
	);
	
	$wp_customize->add_control(
		new WP_Customize_Image_Control( // Use the WP_Customize_Image_Control class
			$wp_customize, // Pass the customizer object
		'fancyboxg15', // Control ID
			array(
				'label'    => __( 'Select Image', 'elina-lite-portfolio-gallery' ), // Control label
				'section'  => 'gallery4', // Section where it appears
				//'settings' => 'gallery1', // Link to the setting ID
			)
		)
	);

	// Gallery Img 16
    $wp_customize->add_setting(
		'fancyboxg16', // Setting ID
		array(
			'default'           => get_template_directory_uri() . '/images/gallery/gal16.jpg', 
			'sanitize_callback' => 'esc_url_raw', // Sanitize to ensure it's a valid URL
		)
	);
	
	$wp_customize->add_control(
		new WP_Customize_Image_Control( // Use the WP_Customize_Image_Control class
			$wp_customize, // Pass the customizer object
		'fancyboxg16', // Control ID
			array(
				'label'    => __( 'Select Image', 'elina-lite-portfolio-gallery' ), // Control label
				'section'  => 'gallery4', // Section where it appears
				//'settings' => 'gallery1', // Link to the setting ID
			)
		)
	);

		 /** Note */
		 $wp_customize->add_setting(
			'gal4pro',
			array(
				'default'           => '',
				'sanitize_callback' => 'wp_kses_post' 
			)
		);
		
		$wp_customize->add_control(
			new Elinalite_Note_Control( 
				$wp_customize,
				'gal4pro',
				array(
					'section'     => 'gallery4',
					'description' => sprintf( __( '%1$sUpgrade to Pro use unlimited images.%2$s %3$sUpgrade to Pro%4$s ', 'elina-lite-portfolio-gallery' ),'<div class="pro-version-button"><span>', '</span>', '<a href="https://pixelonetry.com/downloads/elina-creative-one-page-wordpress-theme/" target="_blank">', '</a></div>' ),
				)
			)
		 );	

	// Gallery Img 17
    $wp_customize->add_setting(
		'fancyboxg17', // Setting ID
		array(
			'default'           => get_template_directory_uri() . '/images/gallery/gal17.jpg', 
			'sanitize_callback' => 'esc_url_raw', // Sanitize to ensure it's a valid URL
		)
	);
	
	$wp_customize->add_control(
		new WP_Customize_Image_Control( // Use the WP_Customize_Image_Control class
			$wp_customize, // Pass the customizer object
		'fancyboxg17', // Control ID
			array(
				'label'    => __( 'Select Image', 'elina-lite-portfolio-gallery' ), // Control label
				'section'  => 'gallery5', // Section where it appears
				//'settings' => 'gallery1', // Link to the setting ID
			)
		)
	);

	// Gallery Img 18
    $wp_customize->add_setting(
		'fancyboxg18', // Setting ID
		array(
			'default'           => get_template_directory_uri() . '/images/gallery/gal18.jpg', 
			'sanitize_callback' => 'esc_url_raw', // Sanitize to ensure it's a valid URL
		)
	);
	
	$wp_customize->add_control(
		new WP_Customize_Image_Control( // Use the WP_Customize_Image_Control class
			$wp_customize, // Pass the customizer object
		'fancyboxg18', // Control ID
			array(
				'label'    => __( 'Select Image', 'elina-lite-portfolio-gallery' ), // Control label
				'section'  => 'gallery5', // Section where it appears
				//'settings' => 'gallery1', // Link to the setting ID
			)
		)
	);

	// Gallery Img 19
    $wp_customize->add_setting(
		'fancyboxg19', // Setting ID
		array(
			'default'           => get_template_directory_uri() . '/images/gallery/gal19.jpg', 
			'sanitize_callback' => 'esc_url_raw', // Sanitize to ensure it's a valid URL
		)
	);
	
	$wp_customize->add_control(
		new WP_Customize_Image_Control( // Use the WP_Customize_Image_Control class
			$wp_customize, // Pass the customizer object
		'fancyboxg19', // Control ID
			array(
				'label'    => __( 'Select Image', 'elina-lite-portfolio-gallery' ), // Control label
				'section'  => 'gallery5', // Section where it appears
				//'settings' => 'gallery1', // Link to the setting ID
			)
		)
	);

	// Gallery Img 20
    $wp_customize->add_setting(
		'fancyboxg20', // Setting ID
		array(
			//'default'           => '', // No default image
			'default'           => get_template_directory_uri() . '/images/gallery/gal20.jpg', 
			'sanitize_callback' => 'esc_url_raw', // Sanitize to ensure it's a valid URL
		)
	);
	
	$wp_customize->add_control(
		new WP_Customize_Image_Control( // Use the WP_Customize_Image_Control class
			$wp_customize, // Pass the customizer object
		'fancyboxg20', // Control ID
			array(
				'label'    => __( 'Select Image', 'elina-lite-portfolio-gallery' ), // Control label
				'section'  => 'gallery5', // Section where it appears
				//'settings' => 'gallery1', // Link to the setting ID
			)
		)
	);

	/** Note */
	$wp_customize->add_setting(
	'gal5pro',
	array(
		'default'           => '',
		'sanitize_callback' => 'wp_kses_post' 
	)
);

$wp_customize->add_control(
	new Elinalite_Note_Control( 
		$wp_customize,
		'gal5pro',
		array(
			'section'     => 'gallery5',
			'description' => sprintf( __( '%1$sUpgrade to Pro use unlimited images.%2$s %3$sUpgrade to Pro%4$s ', 'elina-lite-portfolio-gallery' ),'<div class="pro-version-button"><span>', '</span>', '<a href="https://pixelonetry.com/downloads/elina-creative-one-page-wordpress-theme/" target="_blank">', '</a></div>' ),
		)
	)
 );	


  /** Home Page Settings */
$wp_customize->add_panel( 
	'elina_lite_one_page_home_page_settings',
	 array(
		'priority' => 30,
		'capability' => 'edit_theme_options',
		'title' => __( 'Front Page Settings', 'elina-lite-portfolio-gallery' ),
		'description' => __( 'Customize Home (Front) Page Settings', 'elina-lite-portfolio-gallery' ),
	) 
);

/** About Section */
$wp_customize->add_section(
	'elina_lite_one_page_about_section',
	array(
		'title' => __( 'About Section', 'elina-lite-portfolio-gallery' ),
		'priority' => 20,
		'panel' => 'elina_lite_one_page_home_page_settings',
	)
);


	/** Note */
	$wp_customize->add_setting(
		'about_sec_unlock',
		array(
			'default'           => '',
			'sanitize_callback' => 'wp_kses_post' 
		)
	);
	
	$wp_customize->add_control(
		new Elinalite_Note_Control( 
			$wp_customize,
			'about_sec_unlock',
			array(
				'section'     => 'elina_lite_one_page_about_section',
				'description' => sprintf( __( '%1$sUpgrade to Pro unlock about section.%2$s %3$sUpgrade to Pro%4$s ', 'elina-lite-portfolio-gallery' ),'<div class="pro-version-button"><span>', '</span>', '<a href="https://pixelonetry.com/downloads/elina-creative-one-page-wordpress-theme/" target="_blank">', '</a></div>' ),
			)
		)
	 );	

	 /** Image */
	 $wp_customize->add_setting( 
        'about_sec_unlock_img', 
        array(
            'default'           => 'one',
            'sanitize_callback' => 'elinalite_sanitize_radio'
        ) 
    );
    
    $wp_customize->add_control(
        new Elinalite_Radio_Image_Control(
            $wp_customize,
            'about_sec_unlock_img',
            array(
                'section'    => 'elina_lite_one_page_about_section',
                'feat_class' => 'upg-to-pro',
                'choices'    => array(
                    'one' => get_template_directory_uri() . '/images/section/about-sec.png',
					'two' => get_template_directory_uri() . '/images/section/about-sec-dark.png',
                ),
            )
        )
    );


	/** Services Section */
$wp_customize->add_section(
	'elina_lite_one_page_service_section',
	array(
		'title' => __( 'Service Section', 'elina-lite-portfolio-gallery' ),
		'priority' => 30,
		'panel' => 'elina_lite_one_page_home_page_settings',
	)
);


	/** Note */
	$wp_customize->add_setting(
		'service_sec_unlock',
		array(
			'default'           => '',
			'sanitize_callback' => 'wp_kses_post' 
		)
	);
	
	$wp_customize->add_control(
		new Elinalite_Note_Control( 
			$wp_customize,
			'service_sec_unlock',
			array(
				'section'     => 'elina_lite_one_page_service_section',
				'description' => sprintf( __( '%1$sUpgrade to Pro unlock service section.%2$s %3$sUpgrade to Pro%4$s ', 'elina-lite-portfolio-gallery' ),'<div class="pro-version-button"><span>', '</span>', '<a href="https://pixelonetry.com/downloads/elina-creative-one-page-wordpress-theme/" target="_blank">', '</a></div>' ),
			)
		)
	 );	

	 /** Image */
	 $wp_customize->add_setting( 
        'service_sec_unlock_img', 
        array(
            'default'           => 'one',
            'sanitize_callback' => 'elinalite_sanitize_radio'
        ) 
    );
    
    $wp_customize->add_control(
        new Elinalite_Radio_Image_Control(
            $wp_customize,
            'service_sec_unlock_img',
            array(
                'section'    => 'elina_lite_one_page_service_section',
                'feat_class' => 'upg-to-pro',
                'choices'    => array(
                    'one' => get_template_directory_uri() . '/images/section/service-sec.png',
					'two' => get_template_directory_uri() . '/images/section/service-sec-dark.png',
                ),
            )
        )
    );
	

	/** Skills Section */
$wp_customize->add_section(
	'elina_lite_one_page_skills_section',
	array(
		'title' => __( 'Skills Section', 'elina-lite-portfolio-gallery' ),
		'priority' => 40,
		'panel' => 'elina_lite_one_page_home_page_settings',
	)
);


	/** Note */
	$wp_customize->add_setting(
		'skills_sec_unlock',
		array(
			'default'           => '',
			'sanitize_callback' => 'wp_kses_post' 
		)
	);
	
	$wp_customize->add_control(
		new Elinalite_Note_Control( 
			$wp_customize,
			'skills_sec_unlock',
			array(
				'section'     => 'elina_lite_one_page_skills_section',
				'description' => sprintf( __( '%1$sUpgrade to Pro unlock skills section.%2$s %3$sUpgrade to Pro%4$s ', 'elina-lite-portfolio-gallery' ),'<div class="pro-version-button"><span>', '</span>', '<a href="https://pixelonetry.com/downloads/elina-creative-one-page-wordpress-theme/" target="_blank">', '</a></div>' ),
			)
		)
	 );	

	 /** Image */
	 $wp_customize->add_setting( 
        'skills_sec_unlock_img', 
        array(
            'default'           => 'one',
            'sanitize_callback' => 'elinalite_sanitize_radio'
        ) 
    );
    
    $wp_customize->add_control(
        new Elinalite_Radio_Image_Control(
            $wp_customize,
            'skills_sec_unlock_img',
            array(
                'section'    => 'elina_lite_one_page_skills_section',
                'feat_class' => 'upg-to-pro',
                'choices'    => array(
                'one' => get_template_directory_uri() . '/images/section/skills-sec.png',
				'two' => get_template_directory_uri() . '/images/section/skills-sec-dark.png',
                ),
            )
        )
    );

	/** Pricing Section */
$wp_customize->add_section(
	'elina_lite_one_page_pricing_section',
	array(
		'title' => __( 'Pricing Section', 'elina-lite-portfolio-gallery' ),
		'priority' => 50,
		'panel' => 'elina_lite_one_page_home_page_settings',
	)
);


	/** Note */
	$wp_customize->add_setting(
		'pricing_sec_unlock',
		array(
			'default'           => '',
			'sanitize_callback' => 'wp_kses_post' 
		)
	);
	
	$wp_customize->add_control(
		new Elinalite_Note_Control( 
			$wp_customize,
			'pricing_sec_unlock',
			array(
				'section'     => 'elina_lite_one_page_pricing_section',
				'description' => sprintf( __( '%1$sUpgrade to Pro unlock pricing section.%2$s %3$sUpgrade to Pro%4$s ', 'elina-lite-portfolio-gallery' ),'<div class="pro-version-button"><span>', '</span>', '<a href="https://pixelonetry.com/downloads/elina-creative-one-page-wordpress-theme/" target="_blank">', '</a></div>' ),
			)
		)
	 );	

	 /** Image */
	 $wp_customize->add_setting( 
        'pricing_sec_unlock_img', 
        array(
            'default'           => 'one',
            'sanitize_callback' => 'elinalite_sanitize_radio'
        ) 
    );
    
    $wp_customize->add_control(
        new Elinalite_Radio_Image_Control(
            $wp_customize,
            'pricing_sec_unlock_img',
            array(
                'section'    => 'elina_lite_one_page_pricing_section',
                'feat_class' => 'upg-to-pro',
                'choices'    => array(
                    'one' => get_template_directory_uri() . '/images/section/pricing-sec.png',
					'two' => get_template_directory_uri() . '/images/section/pricing-sec-dark.png',
                ),
            )
        )
    );
	/** Team Section */
$wp_customize->add_section(
	'elina_lite_one_page_team_section',
	array(
		'title' => __( 'Team Section', 'elina-lite-portfolio-gallery' ),
		'priority' => 60,
		'panel' => 'elina_lite_one_page_home_page_settings',
	)
);


	/** Note */
	$wp_customize->add_setting(
		'team_sec_unlock',
		array(
			'default'           => '',
			'sanitize_callback' => 'wp_kses_post' 
		)
	);
	
	$wp_customize->add_control(
		new Elinalite_Note_Control( 
			$wp_customize,
			'team_sec_unlock',
			array(
				'section'     => 'elina_lite_one_page_team_section',
				'description' => sprintf( __( '%1$sUpgrade to Pro unlock team section.%2$s %3$sUpgrade to Pro%4$s ', 'elina-lite-portfolio-gallery' ),'<div class="pro-version-button"><span>', '</span>', '<a href="https://pixelonetry.com/downloads/elina-creative-one-page-wordpress-theme/" target="_blank">', '</a></div>' ),
			)
		)
	 );	

	 /** Image */
	 $wp_customize->add_setting( 
        'team_sec_unlock_img', 
        array(
            'default'           => 'one',
            'sanitize_callback' => 'elinalite_sanitize_radio'
        ) 
    );
    
    $wp_customize->add_control(
        new Elinalite_Radio_Image_Control(
            $wp_customize,
            'team_sec_unlock_img',
            array(
                'section'    => 'elina_lite_one_page_team_section',
                'feat_class' => 'upg-to-pro',
                'choices'    => array(
                    'one' => get_template_directory_uri() . '/images/section/team-sec.png',
					'two' => get_template_directory_uri() . '/images/section/team-sec-dark.png',
                ),
            )
        )
    );
	/** Contact Section */
$wp_customize->add_section(
	'elina_lite_one_page_contact_section',
	array(
		'title' => __( 'Contact Section', 'elina-lite-portfolio-gallery' ),
		'priority' => 70,
		'panel' => 'elina_lite_one_page_home_page_settings',
	)
);


	/** Note */
	$wp_customize->add_setting(
		'contact_sec_unlock',
		array(
			'default'           => '',
			'sanitize_callback' => 'wp_kses_post' 
		)
	);
	
	$wp_customize->add_control(
		new Elinalite_Note_Control( 
			$wp_customize,
			'contact_sec_unlock',
			array(
				'section'     => 'elina_lite_one_page_contact_section',
				'description' => sprintf( __( '%1$sUpgrade to Pro unlock contact section.%2$s %3$sUpgrade to Pro%4$s ', 'elina-lite-portfolio-gallery' ),'<div class="pro-version-button"><span>', '</span>', '<a href="https://pixelonetry.com/downloads/elina-creative-one-page-wordpress-theme/" target="_blank">', '</a></div>' ),
			)
		)
	 );	

	 /** Image */
	 $wp_customize->add_setting( 
        'contact_sec_unlock_img', 
        array(
            'default'           => 'one',
            'sanitize_callback' => 'elinalite_sanitize_radio'
        ) 
    );
    
    $wp_customize->add_control(
        new Elinalite_Radio_Image_Control(
            $wp_customize,
            'contact_sec_unlock_img',
            array(
                'section'    => 'elina_lite_one_page_contact_section',
                'feat_class' => 'upg-to-pro',
                'choices'    => array(
                    'one' => get_template_directory_uri() . '/images/section/contact-sec.png',
					'two' => get_template_directory_uri() . '/images/section/contact-sec-dark.png',
                ),
            )
        )
    );
}

add_action('customize_register', 'my_customize_register');

/** Social Settings */
function my_register_additional_customizer_settings( $wp_customize ) {

	
/*-----------------------------------------------------------------------------------*/
/*	Social Setting
/*-----------------------------------------------------------------------------------*/

$wp_customize->add_section(
	'elinalite_social_Setting',
	array(
		'title' => __( 'Social Settings', 'elina-lite-portfolio-gallery' ),
		'description' => __( 'Leave blank if you do not want to show the social link.', 'elina-lite-portfolio-gallery' ),
		'priority' => 40,
	)
);

/** Facebook */
$wp_customize->add_setting(
	'elinalite_facebook',
	array(
		'default' => '',
		'sanitize_callback' => 'esc_url_raw',
	)
);

$wp_customize->add_control(
	'elinalite_facebook',
	array(
		'label' => __( 'Facebook', 'elina-lite-portfolio-gallery' ),
		'section' => 'elinalite_social_Setting',
		'type' => 'text',
	)
);

/** Twitter */
$wp_customize->add_setting(
	'elinalite_twitter',
	array(
		'default' => '',
		'sanitize_callback' => 'esc_url_raw',
	)
);

$wp_customize->add_control(
	'elinalite_twitter',
	array(
		'label' => __( 'Twitter', 'elina-lite-portfolio-gallery' ),
		'section' => 'elinalite_social_Setting',
		'type' => 'text',
	)
);

/** Pinterest */
$wp_customize->add_setting(
	'elinalite_pinterest',
	array(
		'default' => '',
		'sanitize_callback' => 'esc_url_raw',
	)
);

$wp_customize->add_control(
	'elinalite_pinterest',
	array(
		'label' => __( 'Pinterest', 'elina-lite-portfolio-gallery' ),
		'section' => 'elinalite_social_Setting',
		'type' => 'text',
	)
);

/** LinkedIn */
$wp_customize->add_setting(
	'elinalite_linkedin',
	array(
		'default' => '',
		'sanitize_callback' => 'esc_url_raw',
	)
);

$wp_customize->add_control(
	'elinalite_linkedin',
	array(
		'label' => __( 'LinkedIn', 'elina-lite-portfolio-gallery' ),
		'section' => 'elinalite_social_Setting',
		'type' => 'text',
	)
);

/** Instagram Plus */
$wp_customize->add_setting(
	'elinalite_instagram',
	array(
		'default' => '',
		'sanitize_callback' => 'esc_url_raw',
	)
);

$wp_customize->add_control(
	'elinalite_instagram',
	array(
		'label' => __( 'Instagram', 'elina-lite-portfolio-gallery' ),
		'section' => 'elinalite_social_Setting',
		'type' => 'text',
	)
);

/** Youtube Plus */
$wp_customize->add_setting(
	'elinalite_youtube',
	array(
		'default' => '',
		'sanitize_callback' => 'esc_url_raw',
	)
);

$wp_customize->add_control(
	'elinalite_youtube',
	array(
		'label' => __( 'YouTube', 'elina-lite-portfolio-gallery' ),
		'section' => 'elinalite_social_Setting',
		'type' => 'text',
	)
);


/** Tiktok */
$wp_customize->add_setting(
	'elinalite_tiktok',
	array(
		'default' => '',
		'sanitize_callback' => 'esc_url_raw',
	)
);

$wp_customize->add_control(
	'elinalite_tiktok',
	array(
		'label' => __( 'Tiktok', 'elina-lite-portfolio-gallery' ),
		'section' => 'elinalite_social_Setting',
		'type' => 'text',
	)
);

$wp_customize->add_section(
	'elinalite_footer',
	array(
		'title' => __( 'Footer', 'elina-lite-portfolio-gallery' ),
		'description' => __( 'Footer Settings', 'elina-lite-portfolio-gallery' ),
		'priority' => 40,
	)
);

/**  
 *  Section Footer
 */


$wp_customize->add_setting(
	'elinalite_copyright',
	array(
		'default'           => '2024 - <span>Elina.</span> All Right Recevied</span>',
		'sanitize_callback' => 'wp_kses_post',
	)
);

$wp_customize->add_control(
	'elinalite_copyright',
	array(
		'label' => __( 'Copyright', 'elina-lite-portfolio-gallery' ),
		'section' => 'elinalite_footer',
		'type' => 'textarea',
	)
);

 /** Note */
 $wp_customize->add_setting(
	'footerproupgrade',
	array(
		'default'           => '',
		'sanitize_callback' => 'wp_kses_post' 
	)
);

$wp_customize->add_control(
	new Elinalite_Note_Control( 
		$wp_customize,
		'footerproupgrade',
		array(
			'section'     => 'elinalite_footer',
			'description' => sprintf( __( '%1$sUpgrade to Pro version for remove footer credit.%2$s %3$sUpgrade to Pro%4$s ', 'elina-lite-portfolio-gallery' ),'<div class="pro-version-button"><span>', '</span>', '<a href="https://pixelonetry.com/downloads/elina-creative-one-page-wordpress-theme/" target="_blank">', '</a></div>' ),
		)
	)
);

/**  
 *  Section WooCommerce
 */

  // Add WooCommerce Sidebar Section
  $wp_customize->add_section( 'elinalite_woocommerce_sidebar_section', array(
	'title'       => __( 'Sidebar', 'elina-lite-portfolio-gallery' ),
	'priority'    => 30,
	'description' => __( 'Enable or disable sidebars.', 'elina-lite-portfolio-gallery' ),
) );

// Add Setting for WooCommerce Sidebar
$wp_customize->add_setting( 'elinalite_woocommerce_sidebar_setting', array(
	'default'   => 'yes', // Default value is 'yes'
	'transport' => 'refresh',
	'sanitize_callback' => 'elinalite_sanitize_woocommerce_sidebar_setting',
) );

// Add Control for WooCommerce Sidebar
$wp_customize->add_control( 'elinalite_woocommerce_sidebar_control', array(
	'label'    => __( 'Display WooCommerce Sidebar?', 'elina-lite-portfolio-gallery' ),
	'section'  => 'elinalite_woocommerce_sidebar_section',
	'settings' => 'elinalite_woocommerce_sidebar_setting',
	'type'     => 'radio',
	'choices'  => array(
		'yes' => __( 'Yes', 'elina-lite-portfolio-gallery' ),
		'no'  => __( 'No', 'elina-lite-portfolio-gallery' ),
	),
) );

// Sanitize the setting value
function elinalite_sanitize_woocommerce_sidebar_setting( $input ) {
$valid = array( 'yes', 'no' );
return ( in_array( $input, $valid, true ) ) ? $input : 'yes';
}

/**
 * Go To Pro 
 */


}
add_action( 'customize_register', 'my_register_additional_customizer_settings' );

