<?php
include dirname(__FILE__) . '/post/widget-post.php';
include dirname(__FILE__) . '/logo/widget-logo.php';
include dirname(__FILE__) . '/social-media/widget-social-media.php';

/*====================================================
/* ADD CUSTOM WIDGET
/*====================================================*/
function rt_custom_widget()
{
    register_widget('Retheme_post_widget');
    register_widget('Retheme_logo_widget');
    register_widget('Retheme_social_widget');
}
add_action('widgets_init', 'rt_custom_widget');

/*=================================================;
/* REGISTER WIDGET LOCATION
/*================================================= */
function rt_register_widget() {

    register_sidebar([
        'name' => __('Sidebar', 'jelajah-text'),
        'id' => 'retheme_sidebar',
        'before_widget' => '<div id="%1$s" class="rt-widget is-widget-aside is-layout-flow %2$s">',
        'after_widget' => '</div>',
        'before_title' => '<div class="rt-block-heading"><h3 class="rt-block-heading__title">',
        'after_title' => '</h3></div>',
    ]);

    register_sidebar([
        'name' => __('Footer Column 1', 'jelajah-text'),
        'id' => 'retheme_footer_1',
        'before_widget' => '<div id="%1$s" class="rt-widget is-widget-footer is-layout-flow %2$s">',
        'after_widget' => '</div>',
        'before_title' => '<div class="rt-widget__header"><h3 class="rt-widget__title">',
        'after_title' => '</h3></div>',
    ]);

    register_sidebar([
        'name' => __('Footer Column 2', 'jelajah-text'),
        'id' => 'retheme_footer_2',
        'before_widget' => '<div id="%1$s" class="rt-widget is-widget-footer is-layout-flow %2$s">',
        'after_widget' => '</div>',
        'before_title' => '<div class="rt-widget__header"><h3 class="rt-widget__title">',
        'after_title' => '</h3></div>',
    ]);

    register_sidebar([
        'name' => __('Footer Column 3', 'jelajah-text'),
        'id' => 'retheme_footer_3',
        'before_widget' => '<div id="%1$s" class="rt-widget is-widget-footer is-layout-flow %2$s">',
        'after_widget' => '</div>',
        'before_title' => '<div class="rt-widget__header"><h3 class="rt-widget__title">',
        'after_title' => '</h3></div>',
    ]);

    register_sidebar([
        'name' => __('Footer Column 4', 'jelajah-text'),
        'id' => 'retheme_footer_4',
        'before_widget' => '<div id="%1$s" class="rt-widget is-widget-footer is-layout-flow %2$s">',
        'after_widget' => '</div>',
        'before_title' => '<div class="rt-widget__header"><h3 class="rt-widget__title">',
        'after_title' => '</h3></div>',
    ]);

    register_sidebar([
        'name' => __('Footer Column 5', 'jelajah-text'),
        'id' => 'retheme_footer_5',
        'before_widget' => '<div id="%1$s" class="rt-widget is-widget-footer  is-layout-flow %2$s">',
        'after_widget' => '</div>',
        'before_title' => '<div class="rt-widget__header"><h3 class="rt-widget__title">',
        'after_title' => '</h3></div>',
    ]);

    register_sidebar([
        'name' => __('Footer Column 6', 'jelajah-text'),
        'id' => 'retheme_footer_6',
        'before_widget' => '<div id="%1$s" class="rt-widget is-widget-footer is-layout-flow %2$s">',
        'after_widget' => '</div>',
        'before_title' => '<div class="rt-widget__header"><h3 class="rt-widget__title">',
        'after_title' => '</h3></div>',
    ]);
}
add_action('widgets_init', 'rt_register_widget');
