[wp-hackers] wp_register_script() vs. wp_enqueue_script()?
if.website at gmail.com
Thu Jan 22 03:40:50 GMT 2009
On Wed, Jan 21, 2009 at 8:10 PM, Mike Schinkel
<mikeschinkel at newclarity.net> wrote:
> So does wp_enqueue_script() explicitly NOT establish a name for managing dependencies in the same way that wp_register_script() does? If yes, why do you have to give the script a name in wp_enqueue_script()?
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. That also answers your other
question about duplicate scripts: duplicates are avoided so long as
the handles are the same.
More information about the wp-hackers