[wp-trac] [WordPress Trac] #39693: Fix missing assignment of widgets on theme switch

WordPress Trac noreply at wordpress.org
Thu Sep 21 23:19:21 UTC 2017


#39693: Fix missing assignment of widgets on theme switch
--------------------------------------+------------------------
 Reporter:  melchoyce                 |       Owner:  obenland
     Type:  enhancement               |      Status:  reviewing
 Priority:  high                      |   Milestone:  4.9
Component:  Widgets                   |     Version:
 Severity:  normal                    |  Resolution:
 Keywords:  has-patch has-unit-tests  |     Focuses:
--------------------------------------+------------------------

Comment (by bpayton):

 Replying to [comment:106 obenland]:
 > [attachment:39693.11.diff] fixes a bug, where orphaned widgets that were
 merged into the inactive sidebar would be overwritten with an empty array.

 This looks good to me.

 I have a couple of questions about the test, possibly due to being new to
 WordPress.

 1. Where do the 6 default widgets come from in the following comment?
 Based on my reading of the test, there are 2 specified for
 `wp_inactive_widgets`. Where do the other 4 come from?
     `// 6 default widgets + 1 orphaned calendar widget = 7.`
 2. How do we know to look for `recent-comments-2` in the
 `wp_inactive_widgets` array?

--
Ticket URL: <https://core.trac.wordpress.org/ticket/39693#comment:107>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list