How to Replace Default WordPress jQuery

Change the Default WordPress jQuery with an Older Version

Today I was having issues with an older WordPress template that required an older version of jQuery, but when I updated to the newer version it broke the theme. So I found this snippet that you paste on your template functions to replace the jQuery with an older version of it. 

function replace_core_jquery_version() {
    wp_deregister_script( 'jquery' );
    // Change the URL if you want to load a local copy of jQuery from your own server.
    wp_register_script( 'jquery', "https://code.jquery.com/jquery-1.12.4.min.js", array(), '1.12.4' );
}
add_action( 'wp_enqueue_scripts', 'replace_core_jquery_version' );