Skip to content

Instantly share code, notes, and snippets.

@ontiuk
Created February 19, 2018 12:15
Show Gist options
  • Save ontiuk/3ec4e14045ee1f90ece31a21196a8bbb to your computer and use it in GitHub Desktop.
Save ontiuk/3ec4e14045ee1f90ece31a21196a8bbb to your computer and use it in GitHub Desktop.
iPress RD2 - Config - Update jQuery to latest v2
// Contained within /inc/config.php. Modify default settings
// Dequeue default v1 jQuery, requeue jquery-migrate, add external cdn reference to jQuery v2. Load in header (true)
// Set up scripts - filterable array. See definitions for structure
$ipress_scripts = [
// Core scripts: [ 'script-name', 'script-name2' ... ]
'undo' => [ 'jquery' ],
// Core scripts: [ 'script-name', 'script-name2' ... ]
'core' => [ 'jquery-migrate' ],
// External scripts: [ 'label' => [ 'path_url', (array)dependencies, 'version', 'locale' ] ... ]
'external' => [
'jquery' => [ 'https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js', [], null, true ]
],
// Rest of scripts block....
];
// Initialise scripts
$ipress->scripts->init( $ipress_scripts );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment