[wp-trac] [WordPress Trac] #10804: New action activate_theme
WordPress Trac
wp-trac at lists.automattic.com
Thu Sep 17 22:57:02 UTC 2009
#10804: New action activate_theme
--------------------------+-------------------------------------------------
Reporter: chrisbliss18 | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Unassigned
Component: Themes | Version:
Severity: normal | Keywords: theme,activation,action,has-patch
--------------------------+-------------------------------------------------
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.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/10804>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list