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

WordPress Trac wp-trac at lists.automattic.com
Mon Aug 1 19:08:40 UTC 2011


#17979: Avoid losing widgets when switching themes
--------------------------+------------------
 Reporter:  lancewillett  |       Owner:
     Type:  enhancement   |      Status:  new
 Priority:  high          |   Milestone:  3.3
Component:  Widgets       |     Version:  2.9
 Severity:  normal        |  Resolution:
 Keywords:  ux-feedback   |
--------------------------+------------------

Comment (by azaozz):

 Replying to [comment:25 aaroncampbell]:
 > The problem is that when the `switch_theme` action is fired we don't
 actually have access to the sidebar list from the new theme...
 > Currently the patch attached works if you switch themes and then visit
 the widgets page.

 Ran into the same problem when upgrading the widgets API couple of years
 ago. Was testing to have an option holding the current theme's name and
 check it on admin init. If the name has changed, run an action
 'after_theme_change' and update the option. That would let us shuffle the
 widgets as needed.

 The other part would be to make the theme preview to show the new sidebars
 properly (with reassigned widgets).

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


More information about the wp-trac mailing list