ok if change the way the app.js was loaded
if it can help
function h_remove_jquery() {
if (!is_admin() ) {
if ( $GLOBALS['pagenow'] != 'wp-login.php' ) {
wp_deregister_script('jquery');
// load custom script that contain jquery 3.2
wp_register_script( 'jquery',get_stylesheet_directory_uri() . '/web/js/app.js',array() );
}
}
}
add_action( 'wp_print_scripts', 'h_remove_jquery', 100 );
not related but if you also need to remove jquery migrate that won’t be compatible with your version of jquery
/* remove jquery migrate if jquery is loaded*/
/* https://github.com/cedaro/dequeue-jquery-migrate/blob/develop/dequeue-jquery-migrate.php */
function cedaro_dequeue_jquery_migrate($scripts)
{
if (!is_admin() && !empty($scripts->registered['jquery'])) {
$jquery_dependencies = $scripts->registered['jquery']->deps;
$scripts->registered['jquery']->deps = array_diff($jquery_dependencies, array('jquery-migrate'));
}
}
add_action('wp_default_scripts', 'cedaro_dequeue_jquery_migrate');
`
-
This reply was modified 3 years, 7 months ago by pasnous.
-
This reply was modified 3 years, 7 months ago by pasnous.