switch jquery src from cdn-linked to local libs

This commit is contained in:
ut 2019-03-07 14:21:41 +01:00
commit 76b9b1c0f4
3 changed files with 224 additions and 2 deletions

View file

@ -43,13 +43,18 @@ if ( ! function_exists( 'foundationpress_scripts' ) ) :
wp_deregister_script( 'jquery' );
// CDN hosted jQuery placed in the header, as some plugins require that jQuery is loaded in the header.
wp_enqueue_script( 'jquery', 'https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js', array(), '3.2.1', false );
// wp_enqueue_script( 'jquery', 'https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js', array(), '3.2.1', false );
// we want a local jquery, use the already installed on
wp_enqueue_script( 'jquery', get_stylesheet_directory_uri() . '/dist/assets/js/' . foundationpress_asset_path( 'lib/jquery-3.2.1.min.js' ), array(), '3.2.1', false );
// Deregister the jquery-migrate version bundled with WordPress.
wp_deregister_script( 'jquery-migrate' );
// CDN hosted jQuery migrate for compatibility with jQuery 3.x
wp_register_script( 'jquery-migrate', '//code.jquery.com/jquery-migrate-3.0.1.min.js', array('jquery'), '3.0.1', false );
// wp_register_script( 'jquery-migrate', '//code.jquery.com/jquery-migrate-3.0.1.min.js', array('jquery'), '3.0.1', false );
// we want a local jquery, use the already installed on
wp_enqueue_script( 'jquery', get_stylesheet_directory_uri() . '/dist/assets/js/' . foundationpress_asset_path( 'lib/jquery-migrate-3.0.1.min.js' ), array(), '3.0.1', false );
// Enqueue jQuery migrate. Uncomment the line below to enable.
// wp_enqueue_script( 'jquery-migrate' );