<?php
/**
* Widget Functions.
*
* @package Omega Refrigeration
*/

function omega_refrigeration_widgets_init(){

	register_sidebar(array(
	    'name' => esc_html__('Main Sidebar', 'omega-refrigeration'),
	    'id' => 'sidebar-1',
	    'description' => esc_html__('Add widgets here.', 'omega-refrigeration'),
	    '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_refrigeration_default = omega_refrigeration_get_default_theme_options();
    $omega_refrigeration_footer_column_layout = absint( get_theme_mod( 'omega_refrigeration_footer_column_layout',$omega_refrigeration_default['omega_refrigeration_footer_column_layout'] ) );

    for( $omega_refrigeration_i = 0; $omega_refrigeration_i < $omega_refrigeration_footer_column_layout; $omega_refrigeration_i++ ){
    	
    	if( $omega_refrigeration_i == 0 ){ $omega_refrigeration_count = esc_html__('One','omega-refrigeration'); }
    	if( $omega_refrigeration_i == 1 ){ $omega_refrigeration_count = esc_html__('Two','omega-refrigeration'); }
    	if( $omega_refrigeration_i == 2 ){ $omega_refrigeration_count = esc_html__('Three','omega-refrigeration'); }

	    register_sidebar( array(
	        'name' => esc_html__('Footer Widget ', 'omega-refrigeration').$omega_refrigeration_count,
	        'id' => 'omega-refrigeration-footer-widget-'.$omega_refrigeration_i,
	        'description' => esc_html__('Add widgets here.', 'omega-refrigeration'),
	        '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_refrigeration_widgets_init');