<?php
/**
* Sets setting field for homepage
* 
* @since  Blogto 1.0.0
* @param  array $settings
* @return array Merged array of settings
*
*/
function blogto_frontpage_settings( $settings ){

	$home_settings = array(
		# Settings for slider
		'slider_category' => array(
			'label'   => esc_html__( 'Choose Slider Category', 'blogto' ),
			'section' => 'slider',
			'type'    => 'dropdown-categories',
		),
		'slider_control' => array(
			'label'     => esc_html__( 'Show Slider Control', 'blogto' ),
			'section'   => 'slider',
			'type'      => 'checkbox',
			'transport' => 'postMessage',
		),
		'slider_autoplay' => array(
			'label'   => esc_html__( 'Slider Auto Play', 'blogto' ),
			'section' => 'slider',
			'type'    => 'checkbox'
		),
		'slider_timeout' => array(
			'label'    => esc_html__( 'Slider Timeout ( in sec )', 'blogto' ),
			'section'  => 'slider',
			'type'     => 'number'
		),
		'disable_slider' => array(
			'label'   => esc_html__( 'Disable Slider Section', 'blogto' ),
			'section' => 'slider',
			'type'    => 'checkbox',
		),
		
		# Settings for callback section
		'callback_image' => array(
			'label'   => esc_html__( 'Background Image', 'blogto' ),
			'section' => 'home_callback',
			'type'    => 'image',
		),
		'callback_title' => array(
			'label'   => esc_html__( 'Title', 'blogto' ),
			'section' => 'home_callback',
			'type'    => 'text',
		),
		'callback_button_text' => array(
			'label'   => esc_html__( 'Button Text', 'blogto' ),
			'section' => 'home_callback',
			'type'    => 'text',
		),
		'callback_button_url' => array(
			'label'   => esc_html__( 'Button URL', 'blogto' ),
			'section' => 'home_callback',
			'type'    => 'text',
		),
		'disable_callback' => array(
			'label'   => esc_html__( 'Disable Callback Section', 'blogto' ),
			'section' => 'home_callback',
			'type'    => 'checkbox',
		),
		
		# Settings for Blog section
		'blog_section_title' => array(
			'label'   => esc_html__( 'Blog Section Title', 'blogto' ),
			'section' => 'home_blog',
			'type'    => 'text',
		),
		'blog_category' => array(
			'label'   => esc_html__( 'Choose Blog Category', 'blogto' ),
			'section' => 'home_blog',
			'type'    => 'dropdown-categories',
		),
		'blog_number' => array(
			'label' => esc_html__( 'Number of Posts', 'blogto' ),
			'section' => 'home_blog',
			'type'    => 'number',
			'input_attrs' => array(
				'max' => 3,
				'min' => 1
			)
		),
		'disable_blog' => array(
			'label'   => esc_html__( 'Disable Blog Section', 'blogto' ),
			'section' => 'home_blog',
			'type'    => 'checkbox',
		),

		# Settings for about page
		'about_page'  => array(
			'label'   => esc_html__( 'Select About Page', 'blogto' ),
			'section' => 'home_about',
			'type'    => 'dropdown-pages',
		),
		'about_section_title' => array(
			'label'   => esc_html__( 'About Section Title', 'blogto' ),
			'section' => 'home_about',
			'type'    => 'text',
		),
		'disable_about' => array(
			'label'   => esc_html__( 'Disable About Us Section', 'blogto' ),
			'section' => 'home_about',
			'type'    => 'checkbox',
		),
	);

	return array_merge( $home_settings, $settings );
}
add_filter( 'Blogto_Customizer_fields', 'blogto_frontpage_settings' );