[wp-trac] [WordPress Trac] #19091: After theme switch inactive box is filled with widgets which I haven't used

WordPress Trac wp-trac at lists.automattic.com
Mon Oct 31 18:55:07 UTC 2011


#19091: After theme switch inactive box is filled with widgets which I haven't used
--------------------------+------------------------------
 Reporter:  ocean90       |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Widgets       |     Version:  3.3
 Severity:  normal        |  Resolution:
 Keywords:  needs-patch   |
--------------------------+------------------------------

Comment (by ocean90):

 I noticed, that the inactive widgets are the 7 widgets which aren't used.

 The problem is in [http://core.trac.wordpress.org/browser/trunk/wp-
 includes/widgets.php#L1224 /wp-includes/widgets.php#L1224].

 In my case `$number` is always 2.

 Some ''var_dumps'' from `retrieve_widgets` after a Twenty Eleven to Twenty
 Ten switch:

 var_dump( $registered_sidebar_keys ):
 {{{
 array(6) {
   [0]=>
   string(19) "primary-widget-area"
   [1]=>
   string(21) "secondary-widget-area"
   [2]=>
   string(24) "first-footer-widget-area"
   [3]=>
   string(25) "second-footer-widget-area"
   [4]=>
   string(24) "third-footer-widget-area"
   [5]=>
   string(25) "fourth-footer-widget-area"
 }
 }}}

 var_dump( $sidebars_widgets ):
 {{{
 array(6) {
   ["wp_inactive_widgets"]=>
   array(0) {
   }
   ["sidebar-1"]=>
   array(6) {
     [0]=>
     string(8) "search-2"
     [1]=>
     string(14) "recent-posts-2"
     [2]=>
     string(17) "recent-comments-2"
     [3]=>
     string(10) "archives-2"
     [4]=>
     string(12) "categories-2"
     [5]=>
     string(6) "meta-2"
   }
   ["sidebar-2"]=>
   array(0) {
   }
   ["sidebar-3"]=>
   array(0) {
   }
   ["sidebar-4"]=>
   array(0) {
   }
   ["sidebar-5"]=>
   array(0) {
   }
 }
 }}}

 var_dump( $shown_widgets ):
 {{{
 array(6) {
   [0]=>
   string(8) "search-2"
   [1]=>
   string(14) "recent-posts-2"
   [2]=>
   string(17) "recent-comments-2"
   [3]=>
   string(10) "archives-2"
   [4]=>
   string(12) "categories-2"
   [5]=>
   string(6) "meta-2"
 }
 }}}

 var_dump( $lost_widgets ):
 {{{
 array(7) {
   [0]=>
   string(7) "pages-2"
   [1]=>
   string(10) "calendar-2"
   [2]=>
   string(7) "links-2"
   [3]=>
   string(6) "text-2"
   [4]=>
   string(5) "rss-2"
   [5]=>
   string(11) "tag_cloud-2"
   [6]=>
   string(10) "nav_menu-2"
 }
 }}}

 var_dump( $sidebars_widgets ):
 {{{
 array(7) {
   ["wp_inactive_widgets"]=>
   array(7) {
     [0]=>
     string(7) "pages-2"
     [1]=>
     string(10) "calendar-2"
     [2]=>
     string(7) "links-2"
     [3]=>
     string(6) "text-2"
     [4]=>
     string(5) "rss-2"
     [5]=>
     string(11) "tag_cloud-2"
     [6]=>
     string(10) "nav_menu-2"
   }
   ["primary-widget-area"]=>
   array(6) {
     [0]=>
     string(8) "search-2"
     [1]=>
     string(14) "recent-posts-2"
     [2]=>
     string(17) "recent-comments-2"
     [3]=>
     string(10) "archives-2"
     [4]=>
     string(12) "categories-2"
     [5]=>
     string(6) "meta-2"
   }
   ["secondary-widget-area"]=>
   array(0) {
   }
   ["first-footer-widget-area"]=>
   array(0) {
   }
   ["second-footer-widget-area"]=>
   array(0) {
   }
   ["third-footer-widget-area"]=>
   array(0) {
   }
   ["fourth-footer-widget-area"]=>
   NULL
 }
 }}}


 At the moment I'm not sure why `$number` must be `>2`.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/19091#comment:4>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list