<?php
/**
* Widget Functions.
*
* @package Beauty Parlour Salon
*/

function beauty_parlour_salon_widgets_init(){

	register_sidebar(array(
	    'name' => esc_html__('Main Sidebar', 'beauty-parlour-salon'),
	    'id' => 'sidebar-1',
	    'description' => esc_html__('Add widgets here.', 'beauty-parlour-salon'),
	    'before_widget' => '<div id="%1$s" class="widget %2$s">',
	    'after_widget' => '</div>',
	    'before_title' => '<h3 class="widget-title"><span>',
	    'after_title' => '</span></h3>',
	));


    $beauty_parlour_salon_default = beauty_parlour_salon_get_default_theme_options();
    $beauty_parlour_salon_footer_column_layout = absint( get_theme_mod( 'beauty_parlour_salon_footer_column_layout',$beauty_parlour_salon_default['beauty_parlour_salon_footer_column_layout'] ) );

    for( $beauty_parlour_salon_i = 0; $beauty_parlour_salon_i < $beauty_parlour_salon_footer_column_layout; $beauty_parlour_salon_i++ ){
    	
    	if( $beauty_parlour_salon_i == 0 ){ $beauty_parlour_salon_count = esc_html__('One','beauty-parlour-salon'); }
    	if( $beauty_parlour_salon_i == 1 ){ $beauty_parlour_salon_count = esc_html__('Two','beauty-parlour-salon'); }
    	if( $beauty_parlour_salon_i == 2 ){ $beauty_parlour_salon_count = esc_html__('Three','beauty-parlour-salon'); }

	    register_sidebar( array(
	        'name' => esc_html__('Footer Widget ', 'beauty-parlour-salon').$beauty_parlour_salon_count,
	        'id' => 'beauty-parlour-salon-footer-widget-'.$beauty_parlour_salon_i,
	        'description' => esc_html__('Add widgets here.', 'beauty-parlour-salon'),
	        'before_widget' => '<div id="%1$s" class="widget %2$s">',
	        'after_widget' => '</div>',
	        'before_title' => '<h2 class="widget-title">',
	        'after_title' => '</h2>',
	    ));
	}

}

add_action('widgets_init', 'beauty_parlour_salon_widgets_init');