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

WordPress Trac wp-trac at lists.automattic.com
Thu Sep 1 22:05:12 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 has-patch needs-testing  |
-------------------------------------------------+------------------

Comment (by trevogre):

 On the discussion of widgets. My two cents. I think that widget
 registration is backwards. You need to be able to create widget areas and
 add widgets as data that is always independant of the theme.

 So without a theme you could create mygoofysidebar and add stuff to it.
 And then do the mapping to the sidebar requested by the theme.

 I don't find the idea of auto mapping on theme switching to be that
 compelling.
 Unless it encourages common naming.

 So if I'm a theme dev I know that everyone is nameing their widgets
 sidebar, I can request that widget set.

 <AaronDCampbell> trevogre: Put that on the ticket :)  I think that mapping
 automatically is a good stop-gap so fix things up for now

 I agree that it would be nice to have it work more like menus (make
 sidebars and then assign them to locations) but that needs to be the main
 focus of a release because it'll be a lot of code.

 <trevogre>will do, I'll throw that on the ticket. I haven't dug into the
 widget code so I don't know how much code it would be. I think it could be
 fairly light wieght but it would have to pull the sidebar list from an
 option instead of from register sidebar calls. It could be something like
 the shortcode patch that I just put in.

 Where it would add any sidebars that were registered and just retain all
 of them.

 And you could add a second array to register sidebar names from the
 backend with a loop.

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


More information about the wp-trac mailing list