Until WP 5.0 the below code worked. After WP 5.2 it doesn't work anymore. I receive an error that suggest to use `wp_enqueue_scripts` and to not use `wp_deregister_script anymore`.

```
add_action('init', function() 
{
  if (is_admin()) 
  {
    return;
  }

  global $wp_scripts;
  if (isset($wp_scripts->registered['jquery']->ver)) 
  {
    $ver = $wp_scripts->registered['jquery']->ver;
  } 
  else 
  {
    $ver = '1.12.4';
  }

  wp_deregister_script('jquery');
  wp_register_script('jquery', "https://ajax.googleapis.com/ajax/libs/jquery/$ver/jquery.min.js", false, $ver);
});

```