[wp-hackers] Accessing jQuery in Core for a plugin

ade ade at studiograsshopper.ch
Mon Nov 10 20:57:25 GMT 2008


Otto,

That's perfect. Thanks! :-)

Ade.

----- Original Message ----- 
From: "Otto" <otto at ottodestruct.com>
To: <wp-hackers at lists.automattic.com>
Sent: Monday, November 10, 2008 9:31 PM
Subject: Re: [wp-hackers] Accessing jQuery in Core for a plugin


> wp_enqueue_script('jquery');
> 
> It's just that simple. You need to do it before wp_head though.
> Preferably on the init action hook.
> 
> Alternatively, if your own JS depends on jquery, then you can enqueue
> your own script with a dependancy on jquery:
> wp_enqueue_script('newscript', plugins_url('yourplugin/newscript.js',
> array('jquery'), '1.0' );
> 
> See: http://codex.wordpress.org/Function_Reference/wp_enqueue_script
> 



More information about the wp-hackers mailing list