I have added this code to load Google hosted jQuery
function replace_jquery() {
if (!is_admin()) {
wp_register_script('jquery', 'https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js' );
wp_enqueue_script('jquery');
}
}
add_action('wp_footer', 'replace_jquery', 0 );
A plugin requires jQuery and it is placed in wp_footer
with priority value of 19
. So I want to add jQuery before that. As you can see, I have given the above code a priority of 0
. But when in the output HTML, the jQuery link is added in the last. My guess is that because wp_enqueue_script
has default priority of 20
. If I am right, How do I over ride to load it first ?