Is jQuery included in WordPress by default?

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'); 

Related posts

Leave a Reply

3 comments

  1. 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,

    wp_enqueue_script('jquery') 
    

    grabs jQuery from the core at /wp-includes/js/jquery/jquery.js.

    The “correct” way to add jQuery to your WP site is:

    function theme_scripts() {
      wp_enqueue_script('jquery');
    }
    add_action('wp_enqueue_scripts', 'theme_scripts');
    

    Another catch–if you do use the latest jQuery, be careful that it doesn’t break plugins.

  2. 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 of jQuery just put this block of code to your custom js file

    var $ = jQuery.bind({});