[wp-trac] [WordPress Trac] #38469: wp-includes/widgets.php:1208 Undefined index: wp_inactive_widgets

WordPress Trac noreply at wordpress.org
Mon Oct 24 09:23:50 UTC 2016


#38469: wp-includes/widgets.php:1208 Undefined index: wp_inactive_widgets
--------------------------+-----------------------------
 Reporter:  onnimonni     |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:  4.6.1
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 Hey!

 Multiple persons can reproduce this error in our company.

 After I switch themes I'll get notice about widgets.

 It happens in wp-includes/widgets.php:1208

 I'm using custom wp-content/install.php which doesn't add any widgets
 because we don't usually use them at all.

 This problem gets fixed when I add this snippet in my mu-plugins:

 {{{#!php
 <?php
 add_action( 'init', function() {
     global $sidebars_widgets;
     if (!isset($sidebars_widgets['wp_inactive_widgets'])) {
         $sidebars_widgets['wp_inactive_widgets'] = [];
     }
 });
 }}}


 Custom install.php can be found here: https://github.com/devgeniem/better-
 wp-install-dropin/blob/master/install.php

 '''Details:'''

 $ wp core version
 4.6.1

 $ php -v
 PHP 7.0.12-1

--
Ticket URL: <https://core.trac.wordpress.org/ticket/38469>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list