WP hooks navigation: Home/browse • Actions index • Filters index
To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).
The best way to understand what a hook does is to look at where it occurs in the source code.
do_action( "hook_name" )
apply_filters( "hook_name", "what_to_filter" )
.Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.
This hook occurs 2 times in this file.
Line | Code |
---|---|
647 | } |
648 |
|
649 | $sidebars_widgets = wp_get_sidebars_widgets(); |
650 | if ( empty( $wp_registered_sidebars[ $index ] ) || empty( $sidebars_widgets[ $index ] ) || ! is_array( $sidebars_widgets[ $index ] ) ) { |
651 | /** This action is documented in wp-includes/widget.php */ |
652 | do_action( 'dynamic_sidebar_before', $index, false ); |
653 | /** This action is documented in wp-includes/widget.php */ |
654 | do_action( 'dynamic_sidebar_after', $index, false ); |
655 | /** This filter is documented in wp-includes/widget.php */ |
656 | return apply_filters( 'dynamic_sidebar_has_widgets', false, $index ); |
657 | } |
658 |
|
659 | /** |
660 | * Fires before widgets are rendered in a dynamic sidebar. |
661 | * |
662 | * Note: The action also fires for empty sidebars, and on both the front end |
663 | * and back end, including the Inactive Widgets sidebar on the Widgets screen. |
664 | * |
665 | * @since 3.9.0 |
Line | Code |
792 | * Note: The filter is also evaluated for empty sidebars, and on both the front end |
793 | * and back end, including the Inactive Widgets sidebar on the Widgets screen. |
794 | * |
795 | * @since 3.9.0 |
796 | * |
797 | * @param bool $did_one Whether at least one widget was rendered in the sidebar. |
798 | * Default false. |
799 | * @param int|string $index Index, name, or ID of the dynamic sidebar. |
800 | */ |
801 | return apply_filters( 'dynamic_sidebar_has_widgets', $did_one, $index ); |
802 | } |
803 |
|
804 | /** |
805 | * Determines whether a given widget is displayed on the front end. |
806 | * |
807 | * Either $callback or $id_base can be used |
808 | * $id_base is the first argument when extending WP_Widget class |
809 | * Without the optional $widget_id parameter, returns the ID of the first sidebar |
810 | * in which the first instance of the widget with the given callback or $id_base is found. |