Skip to content

Instantly share code, notes, and snippets.

@Soraph
Last active December 22, 2015 23:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Soraph/6550588 to your computer and use it in GitHub Desktop.
Save Soraph/6550588 to your computer and use it in GitHub Desktop.
Drupal 7 theme function to update the jQuery version used by the website, strongly recommended to restrict this to specific URLs, it will create issues in the default administration theme. More info: http://oldwildissue.wordpress.com/2012/11/19/drupal-7-manually-update-jquery-version/
<?php
function yourtheme_js_alter(&$javascript) {
[...]your stuffs[...]
$jquery_new = drupal_get_path('theme','yourtheme') . '/js/jquery-1.10.2.min.js';
$javascript[$jquery_new] = $javascript['misc/jquery.js'];
$javascript[$jquery_new]['version'] = '1.10.2';
$javascript[$jquery_new]['data'] = $jquery_new;
unset($javascript['misc/jquery.js']);
[...]your other stuffs[...]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment