<?php
/**
* Widget Functions.
*
* @package Omega Hair Salon
*/

function omega_hair_salon_widgets_init(){

	register_sidebar(array(
	    'name' => esc_html__('Main Sidebar', 'omega-hair-salon'),
	    'id' => 'sidebar-1',
	    'description' => esc_html__('Add widgets here.', 'omega-hair-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>',
	));


    $omega_hair_salon_default = omega_hair_salon_get_default_theme_options();
    $omega_hair_salon_omega_hair_salon_footer_column_layout = absint( get_theme_mod( 'omega_hair_salon_footer_column_layout',$omega_hair_salon_default['omega_hair_salon_footer_column_layout'] ) );

    for( $omega_hair_salon_i = 0; $omega_hair_salon_i < $omega_hair_salon_omega_hair_salon_footer_column_layout; $omega_hair_salon_i++ ){
    	
    	if( $omega_hair_salon_i == 0 ){ $omega_hair_salon_count = esc_html__('One','omega-hair-salon'); }
    	if( $omega_hair_salon_i == 1 ){ $omega_hair_salon_count = esc_html__('Two','omega-hair-salon'); }
    	if( $omega_hair_salon_i == 2 ){ $omega_hair_salon_count = esc_html__('Three','omega-hair-salon'); }

	    register_sidebar( array(
	        'name' => esc_html__('Footer Widget ', 'omega-hair-salon').$omega_hair_salon_count,
	        'id' => 'omega-hair-salon-footer-widget-'.$omega_hair_salon_i,
	        'description' => esc_html__('Add widgets here.', 'omega-hair-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', 'omega_hair_salon_widgets_init');