[theme-reviewers] wp_enqueue_script

Otto otto at ottodestruct.com
Wed Sep 15 17:51:43 UTC 2010


On Wed, Sep 15, 2010 at 12:35 PM, Austin Matzko <austin at pressedcode.com> wrote:
> On Wed, Sep 15, 2010 at 12:23 PM, Otto <otto at ottodestruct.com> wrote:
>> I would recommend against use of template_redirect for this. The
>> correct action hook to use is wp_enqueue_scripts, and it even says so
>> right in the code.
>
> That's fine, but in my experience theme authors often do stuff before
> wp_head in their templates that changes the results of the conditional
> "tags."  template_redirect avoids that problem.
>
> What reasons do you have *not* to use template_redirect?

You pretty much answered your own question there. If the conditional
tags are changed, then I'd think you'd want to take that into account
and act accordingly.

-Otto


More information about the theme-reviewers mailing list