- array_merge: documentation ( source)
- array_values: documentation ( source)
<?php
function wp_map_sidebars_widgets( $existing_sidebars_widgets ) {
return $existing_sidebars_widgets;
}
$sidebars_widgets = array( 'sidebar-1' => array(), 'sidebar-2' => array(), 'sidebar-3' => null );
$sidebars_widgets = wp_map_sidebars_widgets( $sidebars_widgets );
// Find hidden/lost multi-widget instances.
$shown_widgets = array_merge( ...array_values( $sidebars_widgets ) );