Make WordPress Core

Ticket #51538: widget_fix.diff

File widget_fix.diff, 822 bytes (added by mhshohel, 5 years ago)

It will fix widget disappear issue with widget ID activity_right from BuddyBoss theme to 2020 theme

  • wp-includes/widgets.php

     
    13691369                                                        }
    13701370
    13711371                                                        // Make sure this sidebar wasn't mapped and removed previously.
    1372                                                         if ( ! empty( $existing_sidebars_widgets[ $sidebar ] ) ) {
     1372                            // Make sure the sidebar also exists on the new sidebar,
     1373                            // Otherwise send it to inactive sidebar
     1374                                                        if ( ! empty( $existing_sidebars_widgets[ $sidebar ] ) && isset( $new_sidebars_widgets[ $sidebar ] ) ) {
    13731375
    13741376                                                                // We have a match that can be mapped!
    13751377                                                                $new_sidebars_widgets[ $new_sidebar ] = array_merge( $new_sidebars_widgets[ $new_sidebar ], $existing_sidebars_widgets[ $sidebar ] );