Last active
October 10, 2015 11:28
-
-
Save steffenr/3683375 to your computer and use it in GitHub Desktop.
update jQuery Version in Drupal 7 for specific site
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function MYMODULE_js_alter(&$javascript) { | |
// check if we are on front_page | |
if(drupal_is_front_page()) { | |
$path = drupal_get_path('module', 'MYMODULE') . '/js/jquery-1.7.1.min.js'; | |
// Copy the current jQuery file settings and change | |
$javascript[$path] = $javascript['misc/jquery.js']; | |
// Update necessary settings | |
$javascript[$path]['version'] = '1.7.1'; | |
$javascript[$path]['data'] = $path; | |
// Finally remove the original jQuery | |
unset($javascript['misc/jquery.js']); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment