[wp-hackers] wp_register_script() vs. wp_enqueue_script()?
frank at bueltge.de
Thu Jan 22 12:50:59 GMT 2009
maybe you understand the functions when you read this small tutorial.
On Thu, Jan 22, 2009 at 7:15 AM, Mike Schinkel
<mikeschinkel at newclarity.net>wrote:
> "Austin Matzko" <if.website at gmail.com> wrote:
> > You need the name (or the "handle") because WP_Dependencies,
> > the class behind all of this, makes sure that it doesn't
> > enqueue the same handle more than once at any given time.
> Thanks for the reply.
> So using enqueue *can* achieve the same register with the addition of also
> emitting the link into the header. If I misunderstand please let me know
> otherwise it's what I assumed would make sense.
> > That also answers your other question about duplicate
> > scripts: duplicates are avoided so long as the handles
> > are the same.
> But that would only help *if* different plugins used the same name, right?
> So three different plugins could register "Nifty Corners" respectively
> each as the following and they would all three get included, right?
> 1.) wp_register_script('niftycorners', ...);
> 2.) wp_register_script('nifty-corners', ...);
> 3.) wp_register_script('nifty_corners', ...);
> Hence my suggestion to have a single place to list how they are used...?
> -Mike Schinkel
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
More information about the wp-hackers