WordPress at a glance
filter is not described

dynamic_sidebar_has_widgets filter-hook . WP 3.9.0

Filters whether a sidebar has widgets.

Note: The filter is also evaluated for empty sidebars, and on both the front end and back end, including the Inactive Widgets sidebar on the Widgets screen.


add_filter( 'dynamic_sidebar_has_widgets', 'filter_function_name_3999', 10, 2 );
function filter_function_name_3999( $did_one, $index ){
	// filter...

	return $did_one;
Whether at least one widget was rendered in the sidebar.
Default: false
Index, name, or ID of the dynamic sidebar.


Since 3.9.0 Introduced.

Where the hook is called

wp-includes/widgets.php 836
return apply_filters( 'dynamic_sidebar_has_widgets', $did_one, $index );
wp-includes/widgets.php 691
return apply_filters( 'dynamic_sidebar_has_widgets', false, $index );

Where in WP core the hook is used

wp-includes/class-wp-customize-widgets.php 124
add_filter( 'dynamic_sidebar_has_widgets', array( $this, 'tally_sidebars_via_dynamic_sidebar_calls' ), 10, 2 );