dynamic_sidebar_after action-hookWP 3.9.0

Fires after widgets are rendered in a dynamic sidebar.

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.

Usage

add_action( 'dynamic_sidebar_after', 'wp_kama_dynamic_sidebar_after_action', 10, 2 );

/**
 * Function for `dynamic_sidebar_after` action-hook.
 * 
 * @param int|string $index       Index, name, or ID of the dynamic sidebar.
 * @param bool       $has_widgets Whether the sidebar is populated with widgets.
 *
 * @return void
 */
function wp_kama_dynamic_sidebar_after_action( $index, $has_widgets ){

	// action...
}
$index(int|string)
Index, name, or ID of the dynamic sidebar.
$has_widgets(true|false)
Whether the sidebar is populated with widgets.
Default: true

Changelog

Since 3.9.0 Introduced.

Where the hook is called

dynamic_sidebar()
dynamic_sidebar_after
wp-includes/widgets.php 866
do_action( 'dynamic_sidebar_after', $index, true );
wp-includes/widgets.php 717
do_action( 'dynamic_sidebar_after', $index, false );

Where the hook is used in WordPress

wp-includes/blocks/widget-group.php 93
add_action( 'dynamic_sidebar_after', 'discard_sidebar_being_rendered' );
wp-includes/class-wp-customize-widgets.php 1779
add_action( 'dynamic_sidebar_after', array( $this, 'end_dynamic_sidebar' ) );