I’m figuring out the ins and outs of WordPress. I know that WordPress sets some default filters and actions in /wp-includes/default-filters.php, but where does it register its scripts like jQuery? We are all able to set jQuery as a dependency or just enqueue it in our themes, but where does WordPress register it?
Any help would be much appreciated!
WordPress registers jQuery in the
wp_default_scripts() function, which is found in
// jQuery $scripts->add( 'jquery', false, array( 'jquery-core', 'jquery-migrate' ), '1.11.3' ); $scripts->add( 'jquery-core', '/wp-includes/js/jquery/jquery.js', array(), '1.11.3' ); $scripts->add( 'jquery-migrate', "/wp-includes/js/jquery/jquery-migrate$suffix.js", array(), '1.2.1' );