<?php
/**
* Widget Functions.
*
* @package Event Decorations
*/

function event_decorations_widgets_init(){

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


    $event_decorations_default = event_decorations_get_default_theme_options();
    $event_decorations_footer_column_layout = absint( get_theme_mod( 'event_decorations_footer_column_layout',$event_decorations_default['event_decorations_footer_column_layout'] ) );

    for( $event_decorations_i = 0; $event_decorations_i < $event_decorations_footer_column_layout; $event_decorations_i++ ){
    	
    	if( $event_decorations_i == 0 ){ $event_decorations_count = esc_html__('One','event-decorations'); }
    	if( $event_decorations_i == 1 ){ $event_decorations_count = esc_html__('Two','event-decorations'); }
    	if( $event_decorations_i == 2 ){ $event_decorations_count = esc_html__('Three','event-decorations'); }

	    register_sidebar( array(
	        'name' => esc_html__('Footer Widget ', 'event-decorations').$event_decorations_count,
	        'id' => 'event-decorations-footer-widget-'.$event_decorations_i,
	        'description' => esc_html__('Add widgets here.', 'event-decorations'),
	        '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', 'event_decorations_widgets_init');