On this page
do_action( 'dynamic_sidebar', array $widget )
Fires before a widget’s display callback is called.
Description
Note: The action fires on both the front end and back end, including for widgets in the Inactive Widgets sidebar on the Widgets screen.
The action is not fired for empty sidebars.
Parameters
$widgetarray-
An associative array of widget arguments.
namestringName of the widget.idstringWidget ID.callbackcallableWhen the hook is fired on the front end,$callbackis an array containing the widget object. Fired on the back end,$callbackis'wp_widget_control', see$_callback.paramsarrayAn associative array of multi-widget arguments.classnamestringCSS class applied to the widget container.descriptionstringThe widget description._callbackarrayWhen the hook is fired on the back end,$_callbackis populated with an array containing the widget object, see$callback.
Source
File: wp-includes/widgets.php. View all references
do_action( 'dynamic_sidebar', $wp_registered_widgets[ $id ] );
Related
Used By
| Used By | Description |
|---|---|
| wp_render_widget() wp-includes/widgets.php | Calls the render callback of a widget and returns the output. |
| dynamic_sidebar() wp-includes/widgets.php | Display dynamic sidebar. |
Changelog
| Version | Description |
|---|---|
| 3.0.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/hooks/dynamic_sidebar