<?php
/**
* Widget Functions.
*
* @package Vacation Rental Booking
*/

function vacation_rental_booking_widgets_init(){

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


    $vacation_rental_booking_default = vacation_rental_booking_get_default_theme_options();
    $vacation_rental_booking_footer_column_layout = absint( get_theme_mod( 'vacation_rental_booking_footer_column_layout',$vacation_rental_booking_default['vacation_rental_booking_footer_column_layout'] ) );

    for( $vacation_rental_booking_i = 0; $vacation_rental_booking_i < $vacation_rental_booking_footer_column_layout; $vacation_rental_booking_i++ ){
    	
    	if( $vacation_rental_booking_i == 0 ){ $vacation_rental_booking_count = esc_html__('One','vacation-rental-booking'); }
    	if( $vacation_rental_booking_i == 1 ){ $vacation_rental_booking_count = esc_html__('Two','vacation-rental-booking'); }
    	if( $vacation_rental_booking_i == 2 ){ $vacation_rental_booking_count = esc_html__('Three','vacation-rental-booking'); }

	    register_sidebar( array(
	        'name' => esc_html__('Footer Widget ', 'vacation-rental-booking').$vacation_rental_booking_count,
	        'id' => 'vacation-rental-booking-footer-widget-'.$vacation_rental_booking_i,
	        'description' => esc_html__('Add widgets here.', 'vacation-rental-booking'),
	        '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', 'vacation_rental_booking_widgets_init');