Add hook before_switch_theme to the switch_theme function
|Reported by:||griffinjt||Owned by:|
There should be another hook in the switch_theme function that occurs before the previous theme is switched but during the switch theme process. The current switch_theme action hook occurs after the new theme has been activated, which takes away the ability to reference data from the previous theme. The are many use-cases that would warrant such a hook, but one in particular is a theme deactivating plugins specific to that theme (as there would be no use for them once the them has been switched). You can always reference the page and $_GET action, but a hook would be easier to work with in my opinion.
I've suggested the name before_switch_theme, but it could be something else. Just as long as it occurs during the switch theme process but before the current theme is replaced.