WordPress at a glance
function is not described

wp_set_sidebars_widgets() WP 2.2.0

Set the sidebar widget option to update sidebars.

No Hooks.

Return

Null. Nothing.

Usage

wp_set_sidebars_widgets( $sidebars_widgets );
$sidebars_widgets(array) (required)
Sidebar widgets and their settings.

Notes

  • Global. Array. $_wp_sidebars_widgets

Changelog

Since 2.2.0 Introduced.

Code of wp_set_sidebars_widgets() WP 5.5.3

<?php
function wp_set_sidebars_widgets( $sidebars_widgets ) {
	global $_wp_sidebars_widgets;

	// Clear cached value used in wp_get_sidebars_widgets().
	$_wp_sidebars_widgets = null;

	if ( ! isset( $sidebars_widgets['array_version'] ) ) {
		$sidebars_widgets['array_version'] = 3;
	}

	update_option( 'sidebars_widgets', $sidebars_widgets );
}