WordPress at Your Fingertips
action is not described

dynamic_sidebar action-hook . WP 3.0.0

Fires before a widget's display callback is called.

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.


add_action( 'dynamic_sidebar', 'action_function_name_2438' );
function action_function_name_2438( $widget ){
	// action...

An associative array of widget arguments.

  • name(string)
    Name of the widget.

  • id(string)
    Widget ID.

  • callback(callable)
    When the hook is fired on the front end, $callback is an array containing the widget object. Fired on the back end, $callback is 'wp_widget_control', see $_callback.

  • params(array)
    An associative array of multi-widget arguments.

  • classname(string)
    CSS class applied to the widget container.

  • description(string)
    The widget description.

  • _callback(array)
    When the hook is fired on the back end, $_callback is populated with an array containing the widget object, see $callback.


Since 3.0.0 Introduced.

Where the hook is called

wp-includes/widgets.php 828
do_action( 'dynamic_sidebar', $wp_registered_widgets[ $id ] );
wp-includes/widgets.php 1974
do_action( 'dynamic_sidebar', $wp_registered_widgets[ $widget_id ] );

Where in WP core the hook is used WordPress

wp-includes/class-wp-customize-widgets.php 123
add_action( 'dynamic_sidebar', array( $this, 'tally_rendered_widgets' ) );