When I downloaded the latest version 3.8.1, inside wp-include/js
there is a jQuery folder.
Can I assume that WordPress will always include it, meaning I don’t have to make my own call? E.g.
wp_register_script('jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js', array(), null, false);
wp_enqueue_script('jquery');
Yes, jQuery is part of WordPress core. But–it can become outdated, because jQuery updates can happen in between WP releases. The recent release of WordPress does use a very recent version of jQuery.
By default,
grabs jQuery from the core at /wp-includes/js/jquery/jquery.js.
The “correct” way to add jQuery to your WP site is:
Another catch–if you do use the latest jQuery, be careful that it doesn’t break plugins.
You still need to enqueue it, but you do not need to register it, as it is registered automatically.
Jquery is included inside the core wordpress files but you need to load it manually for the frontend user.
for admin dashboard it was loaded automatically.
keep in mind you can’t use the shorthand notation
$
.you need to use
jQuery
instead of$
if you want to use
$
instead ofjQuery
just put this block of code to your custom js file