wppaste
WordPress

apply_filters( 'dynamic_sidebar_has_widgets', bool $did_one, int|string $index )

Since
3.9.0
Filters whether a sidebar has widgets.

Description

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.

Compatibility

WordPress
since 3.9.0
  • 6.7.7
  • 6.8.8
  • 6.9.7
  • 7.0.4
  • 7.1.0

Present in every tracked release (6.7.7 to 7.1.0).

Parameters

$did_onebool
Whether at least one widget was rendered in the sidebar.
Default false.
$indexint|string
Index, name, or ID of the dynamic sidebar.

Where this hook fires · 2

  • wp-includes/widgets.php:719dynamic_sidebar()
  • wp-includes/widgets.php:880dynamic_sidebar()

Source code

	 * @since 3.9.0	 *	 * @param bool       $did_one Whether at least one widget was rendered in the sidebar.	 *                            Default false.	 * @param int|string $index   Index, name, or ID of the dynamic sidebar.	 */	return apply_filters( 'dynamic_sidebar_has_widgets', $did_one, $index );} /** * Determines whether a given widget is displayed on the front end. * * Either $callback or $id_base can be used.

Changelog

Introduced in 3.9.0. Unchanged from 6.7.7 through 7.1.0.

  1. 6.7.7
  2. 6.8.8
  3. 6.9.7
  4. 7.0.4
  5. 7.1.0

Signature, return type and hooks compared across 5 parsed releases.

About this page

Parsed data
Generated from the wordpress-develop 6.9.7 tag, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.