[wp-hackers] Accessing jQuery in Core for a plugin
otto at ottodestruct.com
Mon Nov 10 20:31:18 GMT 2008
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:
array('jquery'), '1.0' );
On Mon, Nov 10, 2008 at 1:21 PM, ade <ade at studiograsshopper.ch> wrote:
> Hi all,
> I'm writing a plugin around a jQuery script and I'm trying to understand how best to access jQuery which, if I understand correctly, is included in the Wordpress core files.
> My question is this: in my plugin, how do I register my js script to use the core jQuery? Am I right in thinking I use wp_register_script within an init function? Or do I use wp_enqueue_script? And if I use the latter, will this prevent jQuery being loaded twice if it is already called by another installed plugin? Yes, I'm confused. :-)
> If there isn't a quick and easy answer, a link to any articles out there would be much appreciated.
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
More information about the wp-hackers