I run WordPress version 4.7.2. and it uses jQuery version 1.12. I need to update this version to a higher one,
i can use :
function sof_load_scripts() {
if ( !is_admin() ) {
wp_deregister_script('jquery');
wp_register_script('jquery', 'https://ajax.googleapis.com /ajax/libs/jquery/1.8.2/jquery.min.js', '1.8.2', false);
wp_enqueue_script('jquery');
}
}
add_action( 'wp_enqueue_scripts', 'sof_load_scripts' );
but in the themeforest developers quide we have :
The default version of jQuery being used must never be deregistered. JavaScript and CSS files should never be loaded directly. Plugins should not attempt to load duplicate or alternate versions of files already included in WordPress Core, especially jQuery.
how can i update version of jquery ?