New action activate_theme
|Reported by:||chrisbliss18||Owned by:|
The switch_theme action can be used as a (poorly named) theme deactivation action, but there isn't an action to latch into when a new theme is activated.
This results in people using code that watches for themes.php?activated=true in order to latch their theme activation code to. While this is functional, it has two primary problems:
- It is highly-unnecessary to run that check on every admin page (I've even seen some not limit that check to admin only) when a simple action would be easier to use and wouldn't rely on all that consistent checking.
- While the way the themes.php page may not change, it is still poor practice to tie important code to something that could easily change in the future.
I have a simple patch that adds an activate_theme action. This action passes along the name of the activated theme in case any non-theme code may be interested.
Change History (7)
- Keywords theme activation action removed
- Milestone changed from Unassigned to 2.9
- Milestone 2.9 deleted
- Resolution set to duplicate
- Status changed from new to closed
- Resolution duplicate deleted
- Status changed from closed to reopened