<?php
/**
 * Excel Business widgets
 *
 * @package Excel_Business
 */
 
/**
 * Register widget area.
 *
 * @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar
 */
function excel_business_widgets_init() {
	
    $sidebars = array(
        'sidebar'   => array(
            'name'        => __( 'Sidebar', 'excel-business' ),
            'id'          => 'sidebar', 
            'description' => __( 'Add widgets here.', 'excel-business' ),
        ),
        'intro'   => array(
            'name'        => __( 'Intro Widget Section', 'excel-business' ),
            'id'          => 'intro', 
            'description' => __( 'Add Intro section\'s widgets here. To add "Icon Widget" please install the recommended "Exceltheme Addon" plugin.', 'excel-business' ),
        ),
        'footer-one'=> array(
            'name'        => __( 'Footer One', 'excel-business' ),
            'id'          => 'footer-one', 
            'description' => __( 'Add footer one widgets.', 'excel-business' ),
        ),
        'footer-two'=> array(
            'name'        => __( 'Footer Two', 'excel-business' ),
            'id'          => 'footer-two', 
            'description' => __( 'Add footer two widgets.', 'excel-business' ),
        ),
        'footer-three'=> array(
            'name'        => __( 'Footer Three', 'excel-business' ),
            'id'          => 'footer-three', 
            'description' => __( 'Add footer three widgets.', 'excel-business' ),
        )
    );
    
    foreach( $sidebars as $sidebar ){
        register_sidebar( array(
    		'name'          => esc_html( $sidebar['name'] ),
    		'id'            => esc_attr( $sidebar['id'] ),
    		'description'   => esc_html( $sidebar['description'] ),
    		'before_widget' => '<section id="%1$s" class="widget %2$s">',
    		'after_widget'  => '</section>',
    		'before_title'  => '<h2 class="widget-title">',
    		'after_title'   => '</h2>',
    	) );
    }
}
add_action( 'widgets_init', 'excel_business_widgets_init' );