public function widgetsInit($activeWidgets = [])
    {
        if (!count($activeWidgets)) {
            return;
        }

        foreach ($activeWidgets as $w) {
            add_action('widgets_init',
                function () use ($w) {
                    if (isset($w['id'])) {
                        $name = isset($w['name']) ? $w['name'] : ucfirst(str_replace('_', ' ', $w['id']));
                        if (isset($w['beforeWidget'])) {
                            $beforeWidget = $w['beforeWidget'];
                        } else {
                            $classBeforeWidget = isset($w['classBeforeWidget'])
                                ? $w['classBeforeWidget'] : str_replace('_', '-', $w['id']);
                            $beforeWidget = '<div class="widget ' . $classBeforeWidget . '">';
                        }
                        $afterWidget = isset($w['afterWidget']) ? $w['afterWidget'] : '</div>';
                        $beforeTitle = isset($w['beforeTitle']) ? $w['beforeTitle'] : '<span class="title">';
                        $afterTitle = isset($w['afterTitle']) ? $w['afterTitle'] : '</span>';

                        register_sidebar(
                            [
                                'id' => $w['id'],
                                'name' => $name,
                                'before_widget' => $beforeWidget,
                                'after_widget' => $afterWidget,
                                'before_title' => $beforeTitle,
                                'after_title' => $afterTitle,
                            ]);
                    }
                });
        }
    }