[wp-hackers] Activation hook exist for themes?

Tynan Colin Beatty junsuijin at gmail.com
Mon Sep 14 14:33:58 UTC 2009


your theme's functions.php will only load when it is the active theme, so
Ozh's solution will only trigger when your theme is activated.

On Mon, Sep 14, 2009 at 9:29 AM, Sudar Muthu <sudar at sudarmuthu.com> wrote:

> Hi all,
>
> (Sorry for digging the old thread)
>
> Ozh solution is nice, but it will get triggered every time any theme is
> activated. I wanted to trigger a function only when my theme is triggered.
> Is it possible to do that?
>
> With Regards,
> Sudar
>
> http://SudarMuthu.com
> http://twitter.com/sudarmuthu
>
>
> On Tue, Sep 1, 2009 at 03:14, rajasekharan <websweetweb at gmail.com> wrote:
>
> > I went with Ozh's approach and it worked well. But still, a formal method
> > for this would be convenient and
> > give us some peace of mind. Who knows? Something may change in the next
> > version and this method may break.
> > Hope the core people are reading this thread.
> >
> > Peter Westwood wrote:
> >
> >> On 31 Aug 2009, at 00:46, Dion Hulse (dd32) wrote:
> >>
> >>  Theres a ticket, there was a messy patch from me(IIRC) but i dont think
> >>> its in core yet.
> >>>
> >>
> >> This is what I was thinking of:
> >>
> >> When WordPress switches themes it fires the switch_theme action.
> >>
> >> Unfortunately this is run before the theme is active so is really more
> use
> >> as a deactivation hook.
> >>
> >> Peter
> >>
> >
> > _______________________________________________
> > wp-hackers mailing list
> > wp-hackers at lists.automattic.com
> > http://lists.automattic.com/mailman/listinfo/wp-hackers
> >
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>


More information about the wp-hackers mailing list