dynamic_sidebar_after хук-событиеWP 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.

Использование

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|строка)
Index, name, or ID of the dynamic sidebar.
$has_widgets(true|false)
Whether the sidebar is populated with widgets.
По умолчанию: true

Список изменений

С версии 3.9.0 Введена.

Где вызывается хук

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

Где используется хук в WordPress

wp-includes/blocks/widget-group.php 78
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' ) );