WordPress.org

Make WordPress Core

Ticket #9393: 9393-widgets.diff

File 9393-widgets.diff, 545 bytes (added by nbachiyski, 6 years ago)

Deleting a widget, which is beng used generates non-existing array key notices

  • wp-includes/widgets.php

     
    763763 
    764764        $did_one = false; 
    765765        foreach ( (array) $sidebars_widgets[$index] as $id ) { 
     766                 
     767                if ( !isset($wp_registered_widgets[$id]) ) continue; 
     768                 
    766769                $params = array_merge( 
    767770                        array( array_merge( $sidebar, array('widget_id' => $id, 'widget_name' => $wp_registered_widgets[$id]['name']) ) ), 
    768771                        (array) $wp_registered_widgets[$id]['params']