<?php
/**
* Widget Functions.
*
* @package Online Learning LMS
*/


function online_learning_lms_widgets_init(){

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


    $online_learning_lms_default = online_learning_lms_get_default_theme_options();
    $online_learning_lms_footer_column_layout = absint( get_theme_mod( 'online_learning_lms_footer_column_layout',$online_learning_lms_default['online_learning_lms_footer_column_layout'] ) );

    for( $online_learning_lms_i = 0; $online_learning_lms_i < $online_learning_lms_footer_column_layout; $online_learning_lms_i++ ){
    	
    	if( $online_learning_lms_i == 0 ){ $count = esc_html__('One','online-learning-lms'); }
    	if( $online_learning_lms_i == 1 ){ $count = esc_html__('Two','online-learning-lms'); }
    	if( $online_learning_lms_i == 2 ){ $count = esc_html__('Three','online-learning-lms'); }

	    register_sidebar( array(
	        'name' => esc_html__('Footer Widget ', 'online-learning-lms').$count,
	        'id' => 'online-learning-lms-footer-widget-'.$online_learning_lms_i,
	        'description' => esc_html__('Add widgets here.', 'online-learning-lms'),
	        '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', 'online_learning_lms_widgets_init');