sidebars_widgets filter-hookWP 2.7.0

Filters the list of sidebars and their widgets.

Usage

add_filter( 'sidebars_widgets', 'wp_kama_sidebars_widgets_filter' );

/**
 * Function for `sidebars_widgets` filter-hook.
 * 
 * @param array $sidebars_widgets An associative array of sidebars and their widgets.
 *
 * @return array
 */
function wp_kama_sidebars_widgets_filter( $sidebars_widgets ){

	// filter...
	return $sidebars_widgets;
}
$sidebars_widgets(array)
An associative array of sidebars and their widgets.

Changelog

Since 2.7.0 Introduced.

Where the hook is called

wp_get_sidebars_widgets()
sidebars_widgets
wp-includes/widgets.php 1039
return apply_filters( 'sidebars_widgets', $sidebars_widgets );

Where the hook is used in WordPress

wp-includes/class-wp-customize-widgets.php 1994
add_filter( 'sidebars_widgets', $filter_callback, 1000 );
wp-includes/class-wp-customize-widgets.php 2003
remove_filter( 'sidebars_widgets', $filter_callback, 1000 );
wp-includes/class-wp-customize-widgets.php 374
add_filter( 'sidebars_widgets', array( $this, 'preview_sidebars_widgets' ), 1 );