[theme-reviewers] Integrating JavaScript

Otto otto at ottodestruct.com
Fri Jul 15 18:31:29 UTC 2011


There is no need to register before enqueueing. Enqueueing with all the
extra parameters is the same thing as registering and then enqueueing.

Why register exists at all: For certain highly complex systems, it may make
more sense to register all your scripts in one place, then enqueue them only
when needed.

For simpler cases, just enqueue the thing. One function call. Simpler.

-Otto


On Fri, Jul 15, 2011 at 11:07 AM, Tolu Sonaike <sonaike at gmail.com> wrote:

> I Co-sign this question as i have spent several hours trying to figure
> this out. Even the parameters are pretty much the same. Some people seem
> to skip registering
>
> On Fri, 2011-07-15 at 16:54 +0100, esmi at quirm dot net wrote:
> > on 14/07/2011 13:14 Chip Bennett said the following:
> > > Those scripts look fine to include; however, you will need to register
> and
> > > enqueue them properly, using wp_register_script() and
> wp_enqueue_script(),
> > > via a function hooked into the wp_enqueue_scripts hook.
> >
> > [Playing catch-up]
> >
> > This brings up a question that I'm pretty sure remained unanswered on
> > the support forums. Is there any benefit to going through the full
> > register then enqueue for a script compared to just dropping everything
> > into an enqueue? Both methods seem to have equal weight in the Codex.
> >
> > Mel
> >
> > _______________________________________________
> > theme-reviewers mailing list
> > theme-reviewers at lists.wordpress.org
> > http://lists.wordpress.org/mailman/listinfo/theme-reviewers
>
>
> _______________________________________________
> 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/20110715/d2e20ae5/attachment.htm>


More information about the theme-reviewers mailing list