[theme-reviewers] wp_enqueue_script

Edward Caissie edward.caissie at gmail.com
Wed Sep 15 16:01:21 UTC 2010


Just a thought ...

IF 'template_redirect' is being co-opted into this role, could not a new
more appropriately named hook be considered, perhaps something along the
lines of: 'pre_frontend' ... which may lead to a potential 'post_frontend'
as well? Even something prefixed with 'before_' and 'after_' would be great.

I'm just thinking something that has a slightly more intuitive name
convention rather than relying on an in-depth recognition of hook/action
priority sequences.


Cais.

On Wed, Sep 15, 2010 at 11:35 AM, Andrew Nacin <wp at andrewnacin.com> wrote:

>
>
> On Wed, Sep 15, 2010 at 11:31 AM, Austin Matzko <austin at pressedcode.com>wrote:
>
>> On Wed, Sep 15, 2010 at 10:21 AM, Chip Bennett <chip at chipbennett.net>
>> wrote:
>> > But, what we really need is what the official best-practice suggestion
>> will
>> > be, for the purposes of the Guidelines. We need to ensure that all
>> reviewers
>> > will be making consistent suggestions with respect to
>> wp_enqueue_script()
>> > within functions.php.
>>
>> It's really a range depending on what you're trying to do: before init
>> is too early; default wp_head is too late.
>>
>> I would strongly recommend that front-end scripts not be enqueued in
>> the admin, so that means checking that is_admin() returns false if a
>> front-end conditional "tag" like is_singular() isn't already used.
>
>
> The point is, before init is too early, but on init means it'll show up in
> the admin.
> Hence template_redirect is a good option, as that is enough to ensure it
> only
> gets enqueued for the frontend, with no is_admin() check required.
>
> _______________________________________________
> theme-reviewers mailing list
> theme-reviewers at lists.wordpress.org
> http://lists.wordpress.org/mailman/listinfo/theme-reviewers
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.wordpress.org/pipermail/theme-reviewers/attachments/20100915/069b16aa/attachment.htm>


More information about the theme-reviewers mailing list