Create a gist now

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?php
function jQuery3(){
// Apenas para mudar a versão automaticamente
$date = date("dmy");
// Le a função apenas no front do site
if (!is_admin()){
// Tira o registro do Jquery que estava funcionando
wp_deregister_script('jquery');
// Registra o novo script
wp_register_script('jquery', "https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js", false, $date);
// Aponta o carregamento do script
wp_enqueue_script('jquery');
}
}
add_action('init', 'jQuery3');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment