#15648 closed enhancement (wontfix)
switch_theme action hook may provide the old template value
Reported by: | drzraf | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | trivial | Version: | |
Component: | Themes | Keywords: | |
Focuses: | Cc: |
Description
When someone change its theme, and both support custom header, then the banner and the text color are not preserved (these options are theme specific)
Anyway, one may want to preserve these values :
- check if the new theme has its default value
- check if the old theme values are compatible
- ...
- migrate the values
But in order to do this, WordPress should provide the value of the old theme in use. It would be easy to get it in switch_theme() and to send it as a second argument to the action hook.
Attachments (1)
Change History (5)
#1
@
14 years ago
- Keywords needs-patch added; theme switch custom header defaults removed
- Milestone changed from Awaiting Review to Future Release
- Type changed from feature request to enhancement
#2
@
14 years ago
- Cc raphael.droz@… added
simple patch attached.
The only consumer of this hook in the core is "wp-includes/default-widgets.php" which doesn't use the arguments.
Backward-compatibility may be an issue until one $(grep) for "add_action.*switch_theme" in the plugins & themes repositories to have a clear sight about what is using it isn't ?
Note: See
TracTickets for help on using
tickets.
I hate that hook, since it passes get_current_theme(), which is a name rather than a slug, instead of stylesheet and template.
We can grab the old stylesheet and template value and pass those. Let's pass all four?