Add widgets to the theme sidebars.

@param $sidebars
487993
protected function setupSidebars($sidebars)
    {
        // load current widget condig
        $active_widgets = get_option('sidebars_widgets');

        // collect widgets to be added to sidebars
        foreach ($sidebars as $sidebar => $widgets) {
            $new_widgets = [];
            foreach ($widgets as $type => $data) {
                // load all widgets for this type
                $widget = get_option('widget_' . $type);

                // add a new widget and retrieve id
                $widget[] = $data;
                end($widget);
                $id = key($widget);

                // save the widgets back to db
                update_option('widget_' . $type, $widget);

                // add the new widget id to active widgets
                $new_widgets[] = $type . '-' . $id;
            }
            // set active widgets for sidebar
            $active_widgets[$sidebar] = $new_widgets;
        }
        // save sidebars with widgets
        update_option('sidebars_widgets', $active_widgets);
    }
421980
public function addSidebarsMetaBoxes()
    {
        global $wp_registered_sidebars;

        $template = \Modularity\Helper\Post::getPostTemplate();
        $sidebars = null;

        $activeAreas = $this->getActiveAreas($template);


        // Add no active sidebars message if no active sidebars exists
        if (is_array($activeAreas) && count($activeAreas) === 0) {
            add_meta_box(
                'no-sidebars',
                __('No active sidebar areas', 'modularity'),
                function () {
                    echo '<p>' . __('There\'s no active sidebars. Please activate sidebar areas in the Modularity Options to add modules.', 'modularity') . '</p>';
                },
                $this->screenHook,
                'normal',
                'low',
                null
            );

            return;
        }

        if (is_array($activeAreas) && !empty($activeAreas)) {
            foreach ($activeAreas as $area) {
                if (isset($wp_registered_sidebars[$area])) {
                    $sidebars[$area] = $wp_registered_sidebars[$area];
                }
            }

            if (is_array($sidebars)) {
                foreach ($sidebars as $sidebar) {
                    $this->sidebarMetaBox($sidebar);
                }
            }
        }
    }
54836
public int addWidget (Widget widget, int colSpan, String... styles)
    {
        int row = getRowCount();
        setWidget(row, 0, widget, colSpan, styles);
        return row;
    }
1242981
public function addExtensions(Extension ...$extensions): void
    {
        foreach ($extensions as $extension)
        {
            $this->extensions->attach($extension);
        }
    }
871043
public function addWidgetConfig(WidgetConfig $widget)
    {
        if ($widget instanceof WidgetContainerConfig) {
            $this->addContainer($widget);
        } elseif (Development::isEnabled()) {
            $this->checkIsValidWidget($widget);
        }

        $this->widgets[] = $widget;
    }
798496
public function add(HookInterface ...$hooks): void
    {
        $this->hooks = array_values(
            array_unique(
                array_merge($this->hooks, $hooks),
                SORT_REGULAR
            )
        );
    }
935054
public function addNotifications(array $notifications)
    {
        foreach ($notifications as $notification) {
            if (in_array($notification, $this->notifications, true)) {
                continue;
            }

            $this->addNotification($notification);
        }
    }
1250281
def add_widget(self, w):
        """"""
        if self.layout():
            self.layout().addWidget(w)
        else:
            layout = QVBoxLayout(self)
            layout.addWidget(w)
28808
public function addConfigs($configs)
    {
        foreach ($configs as $config => $value) {
            $this->configs[$config] = $value;
        }
    }
58575
public function addStylesheet($files)
    {
        $files = array_filter((array) $files);

        foreach ($files as $v) {
            if ($v instanceof DomDocument) {
                $this->styles[] = $v;
            } elseif (!is_string($v) || in_array($v, $this->styles, true)) {
                return;
            } elseif (is_string($v)) {
                $this->styles[] = $v;
            }
        }
    }
115127
public void addBottomWidget(Widget w) {

        m_content.removeStyleName(I_CmsLayoutBundle.INSTANCE.dialogCss().alertMainContent());
        m_bottomWidgets.getElement().getStyle().clearDisplay();
        m_bottomWidgets.add(w);

    }
643142
public function addHeaders(array $headers)
    {
        foreach ($headers as $name => $content) {
            $this->headers[$name] = $content;
        }
    }
209019
public function addPartials($_partials)
    {
        foreach ($_partials as $partial => $value) {

            $this->_partials[$partial] = $value;
        }
    }
289456
protected function registerBackendReportWidgets()
    {
        WidgetManager::instance()->registerReportWidgets(function ($manager) {
            $manager->registerReportWidget(\Cms\ReportWidgets\ActiveTheme::class, [
                'label'   => 'cms::lang.dashboard.active_theme.widget_title_default',
                'context' => 'dashboard'
            ]);
        });
    }
398229
public function addAppends($appends)
	{
		if (is_string($appends)) {
			$appends = func_get_args();
		}

		$this->appends = array_merge($this->appends, $appends);

		return $this;
	}
1244305
public static function addCommonStylesheets($commonStylesheets)
    {
        foreach (GeneralUtility::trimExplode(',', $commonStylesheets, true) as $commonStylesheet) {
            $commonStylesheet = self::resolveUrl($commonStylesheet);
            if ($commonStylesheet) {
                self::$commonStylesheets[] = $commonStylesheet;
            }
        }
    }
1258251
public function add($items = [])
    {
        if (!is_array($items) || func_num_args() > 1) {
            $items = func_get_args();
        }

        $this->push($this->formatInnerField(null, $items));
    }