dynamic_sidebar_before

dynamic_sidebar_before

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: action
See hook in action

See hook in core

Displaying hooks found in version: wordpress-6.7.2

do_action('dynamic_sidebar_before') is found 2 times:

  • /wp-includes/widgets.php line 715
    712
    713
    714
    715
    716
    717
    718
    719
    720
    $sidebars_widgets = wp_get_sidebars_widgets();
    if ( empty( $wp_registered_sidebars[ $index ] ) || empty( $sidebars_widgets[ $index ] ) || ! is_array( $sidebars_widgets[ $index ] ) ) {
        /** This action is documented in wp-includes/widget.php */
        do_action( 'dynamic_sidebar_before', $index, false );
        /** This action is documented in wp-includes/widget.php */
        do_action( 'dynamic_sidebar_after', $index, false );
        /** This filter is documented in wp-includes/widget.php */
        return apply_filters( 'dynamic_sidebar_has_widgets', false, $index );
    }
  • /wp-includes/widgets.php line 738
    734
    735
    736
    737
    738
    739
    740
    741
    742
    743
    744
    * @param int|string $index       Index, name, or ID of the dynamic sidebar.
     * @param bool       $has_widgets Whether the sidebar is populated with widgets.
     *                                Default true.
     */
    do_action( 'dynamic_sidebar_before', $index, true );
     
    if ( ! is_admin() && ! empty( $sidebar['before_sidebar'] ) ) {
        echo $sidebar['before_sidebar'];
    }
     
    $did_one = false;

See this hook used in plugins: