<?php

/**
 * Footer Options
 *
 * @package Charity_Elite
 */

$wp_customize->add_section(
	'charity_elite_footer_options',
	array(
		'panel' => 'charity_elite_theme_options',
		'title' => esc_html__( 'Footer Options', 'charity-elite' ),
	)
);

// Footer Options - Background Image.
$wp_customize->add_setting(
	'charity_elite_footer_bg_image',
	array(
		'default'           => '',
		'sanitize_callback' => 'charity_elite_sanitize_image',
	)
);

$wp_customize->add_control(
	new WP_Customize_Image_Control(
		$wp_customize,
		'charity_elite_footer_bg_image',
		array(
			'label'    => esc_html__( 'Footer Background Image', 'charity-elite' ),
			'section'  => 'charity_elite_footer_options',
			'settings' => 'charity_elite_footer_bg_image',
		)
	)
);

// Footer Options - Copyright Text.
/* translators: 1: Year, 2: Site Title with home URL. */
$copyright_default = sprintf( esc_html_x( 'Copyright &copy; %1$s %2$s', '1: Year, 2: Site Title with home URL', 'charity-elite' ), '[the-year]', '[site-link]' );
$wp_customize->add_setting(
	'charity_elite_footer_copyright_text',
	array(
		'default'           => $copyright_default,
		'sanitize_callback' => 'wp_kses_post',
	)
);

$wp_customize->add_control(
	'charity_elite_footer_copyright_text',
	array(
		'label'    => esc_html__( 'Copyright Text', 'charity-elite' ),
		'section'  => 'charity_elite_footer_options',
		'settings' => 'charity_elite_footer_copyright_text',
		'type'     => 'textarea',
	)
);

// Footer Options - Scroll Top.
$wp_customize->add_setting(
	'charity_elite_scroll_top',
	array(
		'sanitize_callback' => 'charity_elite_sanitize_switch',
		'default'           => true,
	)
);

$wp_customize->add_control(
	new Charity_Elite_Toggle_Switch_Custom_Control(
		$wp_customize,
		'charity_elite_scroll_top',
		array(
			'label'   => esc_html__( 'Enable Scroll Top Button', 'charity-elite' ),
			'section' => 'charity_elite_footer_options',
		)
	)
);
