WordPress.org

Make WordPress Core

Ticket #33915: 33915.diff

File 33915.diff, 1.1 KB (added by ShinichiN, 6 years ago)

brought from #34942

  • src/wp-includes/widgets.php

     
    617617        }
    618618
    619619        $sidebars_widgets = wp_get_sidebars_widgets();
     620
     621        /**
     622         * Filter the index (sidebar name) before generating the widget area.
     623         *
     624         * @since 4.5.0
     625         *
     626         * @param string $index                  The name of the sidebar which is going to be generated.
     627         * @param array  $wp_registered_sidebars Defined widget areas.
     628         * @param array  $wp_registered_widgets  All the widgets user has created.
     629         * @param array  $sidebars_widgets       List of inactive widgets and all widget areas with their allocated widgets.
     630         */
     631        $index = apply_filters( 'dynamic_sidebar_index', $index, $wp_registered_sidebars, $wp_registered_widgets, $sidebars_widgets );
     632
    620633        if ( empty( $wp_registered_sidebars[ $index ] ) || empty( $sidebars_widgets[ $index ] ) || ! is_array( $sidebars_widgets[ $index ] ) ) {
    621634                /** This action is documented in wp-includes/widget.php */
    622635                do_action( 'dynamic_sidebar_before', $index, false );