<?php 

$wp_customize->add_section(
	'moral_magazine_homepage_sortable',
	array(
		'title' => esc_html__( 'Homepage Sort', 'moral-magazine' ),
		'panel' => 'moral_magazine_home_panel',
	)
);


$wp_customize->add_setting(	
	'moral_magazine_homepage_sortable',
	array(
		'sanitize_callback' => 'moral_magazine_sanitize_sort',
		'default'	=> array( 'breaking-news', 'hero-banner', 'featured-news', 'editorial', 'main-post', 'have-missed' )
	)
);

$wp_customize->add_control( 
	new Moral_Magazine_Customize_Control_Sort_Sections( 
		$wp_customize,
		'moral_magazine_homepage_sortable',
		array(
			'section'		=> 'moral_magazine_homepage_sortable',
			'type'			=> 'hompage-sortable',
			'label'			=> esc_html__( 'Main Sections Sort', 'moral-magazine' ),
			'description'			=> esc_html__( 'Hold and drag to sort the sections', 'moral-magazine' ),
			'choices'		=> array( 
				'breaking-news' => array( 
					'name' => __( 'Breaking News', 'moral-magazine' ),
					'section_id' => 'moral_magazine_breaking_news'
				),
				'hero-banner' => array( 
					'name' => __( 'Hero Banner', 'moral-magazine' ),
					'section_id' => 'moral_magazine_hero_banner'
				),
				'featured-news' => array( 
					'name' => __( 'Featured News', 'moral-magazine' ),
					'section_id' => 'moral_magazine_featured_news'
				),
				'editorial' => array( 
					'name' => __( 'Editorial', 'moral-magazine' ),
					'section_id' => 'moral_magazine_editorial'
				),
				'main-post' => array( 
					'name' => __( 'Main Post', 'moral-magazine' ),
					'section_id' => 'moral_magazine_main_post'
				),
				'have-missed' => array( 
					'name' => __( 'Have Missed', 'moral-magazine' ),
					'section_id' => 'moral_magazine_have_missed'
				),
			),
		)
	)
);

$wp_customize->add_setting(	
	'moral_magazine_homepage_inner_section_sortable',
	array(
		'sanitize_callback' => 'moral_magazine_sanitize_sort',
		'default'	=> array( 'travel-news', 'business-news' )
	)
);

$wp_customize->add_control( 
	new Moral_Magazine_Customize_Control_Sort_Sections( 
		$wp_customize,
		'moral_magazine_homepage_inner_section_sortable',
		array(
			'section'		=> 'moral_magazine_homepage_sortable',
			'type'			=> 'hompage-sortable',
			'label'			=> esc_html__( 'Main Post Sections Sort', 'moral-magazine' ),
			'description'			=> esc_html__( 'Hold and drag to sort the sections', 'moral-magazine' ),
			'choices'		=> array( 
				'business-news' => array( 
					'name' => __( 'Business News', 'moral-magazine' ),
					'section_id' => 'moral_magazine_business_news'
				),				
				'travel-news' => array( 
					'name' => __( 'Travel News', 'moral-magazine' ),
					'section_id' => 'moral_magazine_travel_news'
				),
				
			),
		)
	)
);