[wp-trac] [WordPress Trac] #17979: Avoid losing widgets when switching themes

WordPress Trac wp-trac at lists.automattic.com
Mon Jul 4 16:46:36 UTC 2011


#17979: Avoid losing widgets when switching themes
--------------------------+-----------------------------
 Reporter:  lancewillett  |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Widgets       |    Version:  3.2
 Severity:  major         |   Keywords:  dev-feedback
--------------------------+-----------------------------
 Symptom: when switching themes all widgets are moved to "Inactive Widgets"
 area, leaving an empty sidebar.

 This happens when:

  1. New theme has a different number of registered sidebars than old
 theme.
  2. New theme and old theme have the same number of registered sidebars,
 but the ID value for the sidebar is different between the two.

 Widgets should never be put into Inactive if the new theme has a least one
 sidebar registered. The ID values for registered sidebars in themes should
 be ignored and not used for comparison.

 Here are three files that contain the important pieces:

  - <code>switch_theme()</code> in wp-includes/theme.php
  - <code>retrieve_widgets()</code> in wp-admin/widgets.php
  - <code>wp_get_sidebars_widgets()</code> in wp-includes/widgets.php

 Possibly related to #9695, #9770, #10092, #10300, #10440, #11160.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/17979>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list