dynamic_sidebar_before WordPress Action Hook
The dynamic_sidebar_before hook is a WordPress hook that allows you to add content to the beginning of a sidebar. This hook is useful for adding custom widgets or other content to your sidebar.
do_action( 'dynamic_sidebar_before', int|string $index , bool $has_widgets ) #
Fires before widgets are rendered in a dynamic sidebar.
Description
Note: The action also fires for empty sidebars, and on both the front end and back end, including the Inactive Widgets sidebar on the Widgets screen.
Parameters
- $index
(int|string)Index, name, or ID of the dynamic sidebar.
- $has_widgets
(bool)Whether the sidebar is populated with widgets. Default true.
Source
File: wp-includes/widgets.php
Changelog
Version | Description |
---|---|
3.9.0 | Introduced. |