Results 1 to 3 of 3

Threaded View

  1. #1
    ddm
    ddm is offline Former Member
    Join Date
    July 2006
    Posts
    1,118
    Thanks
    418
    Thanked 470 Times in 287 Posts

    Default little hack to update your Jquery on Wordpress

    It seems jquery is baked into WP these days, and self hosted. Doesn't seem to update, despite known vulnerabilities.
    chuck this code in your theme /child theme functions.php and it will enqueue a nice up to date CDN version

    Code:
    
    
    function modify_jquery()
    {
    	wp_deregister_script('jquery');
    	wp_register_script('jquery', ("https://code.jquery.com/jquery-3.5.1.min.js"), false);
    	wp_enqueue_script('jquery');
    }
    
    
    add_action('wp_enqueue_scripts', 'modify_jquery');
    [some tools whinge about this..issue, eg lighthouse, fwiw]

  2. The Following 3 Users Say Thank You to ddm For This Useful Post:

    DaftDog (23 June 2020), MMM (21 June 2020), universal4 (19 June 2020)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •