[wp-trac] [WordPress Trac] #22401: Add information about old theme to 'theme_switched' action

WordPress Trac noreply at wordpress.org
Sat Nov 10 02:14:48 UTC 2012


#22401: Add information about old theme to 'theme_switched' action
-----------------------------+-------------------------
 Reporter:  evansolomon      |       Type:  enhancement
   Status:  new              |   Priority:  normal
Milestone:  Awaiting Review  |  Component:  Themes
  Version:                   |   Severity:  normal
 Keywords:  needs-patch      |
-----------------------------+-------------------------
 Currently the 'theme_switch' action passes data about the theme you're
 switching to, but not the theme you're switching from.  Adding it there
 would make it easier to juggle functionality that needs to know about new
 and old themes.  Right now some of this happens by
 [http://core.trac.wordpress.org/browser/trunk/wp-
 includes/theme.php?rev=22516#L696 setting an option] ('theme_switched')
 and [http://core.trac.wordpress.org/browser/trunk/wp-
 includes/theme.php?rev=22516#L1598 checking for it] on
 [http://core.trac.wordpress.org/browser/trunk/wp-includes/default-
 filters.php?rev=22516#L214 init], then deleting the option.  That could be
 simplified by just passing the old theme's data in theme_switched.

 There's an added benefit that we avoid checking for an option on every
 single request that usually won't be there.

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


More information about the wp-trac mailing list