<?php

function bexplore_footer_settings_register( $wp_customize ) {

	/**
	 * Add Footer Settings Panel
	 *
	 * @since 1.0.0
	 */
	$wp_customize->add_panel('footer_settings_panel',array(
		'priority'       => 10,
		'capability'     => 'edit_theme_options',
		'title'          => __( 'Footer', 'bexplore' ),
	));
	/**
	 * Footer section
	 */
	$wp_customize->add_section('bexplore_footer_options',
		array(
			'title' => __('Footer Section', 'bexplore'),
			'priority' => 15,
			'panel' => 'footer_settings_panel'
		)
	);

	$wp_customize->add_setting('bexplore_footer_copy_text',
		array(
			'default' => __('BExplore | All rights reserved', 'bexplore'),
			'sanitize_callback' => 'sanitize_text_field',
			'transport' => 'refresh',
		)
	);

	$wp_customize->add_control('bexplore_footer_copy_text',
		array(
			'type' => 'textarea',
			'priority' => 15,
			'section' => 'bexplore_footer_options',
			'label' => __('Footer copyright text','bexplore')
		)
	);

	$wp_customize->add_setting('bexplore_footer_text',
		array(
			'default' => __('Powered by WordPress', 'bexplore'),
			'sanitize_callback' => 'sanitize_text_field',
			'transport' => 'refresh',
		)
	);

	$wp_customize->add_control('bexplore_footer_text',
		array(
			'type' => 'textarea',
			'priority' => 15,
			'section' => 'bexplore_footer_options',
			'label' => __('Footer text','bexplore')
		)
	);

	/**
	 * Footer Section Background
	 */
	$wp_customize->add_section('be_footer_section_clr',
		array(
			'title' => __('Footer Background Color', 'bexplore'),
			'priority' => 15,
			'panel' => 'footer_settings_panel'
		)
	);

	// Footer Top Background Color
	$wp_customize->add_setting(
		'be_footer_top_bg_color',
		array(
			'default' => '#f1f5f9',
			'transport' => 'postMessage',
			'sanitize_callback' => 'sanitize_hex_color',
		)
	);
	$wp_customize->add_control(
		new WP_Customize_Color_Control(
			$wp_customize,
			'be_footer_top_bg_color',
			array(
				'label' => __('Footer Background Color', 'bexplore'),
				'section' => 'be_footer_section_clr',
				'priority' => 10,
			))
	);

	// Footer Bottom Background Color
	$wp_customize->add_setting(
		'be_footer_bg_color',
		array(
			'default' => '#2c3e50',
			'transport' => 'postMessage',
			'sanitize_callback' => 'sanitize_hex_color',
		)
	);
	$wp_customize->add_control(
		new WP_Customize_Color_Control(
			$wp_customize,
			'be_footer_bg_color',
			array(
				'label' => __('Footer Bottom Background Color', 'bexplore'),
				'section' => 'be_footer_section_clr',
				'priority' => 10,
			))
	);

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