This is what I’m using to make sure that I have jquery-ui-core available:
if (!is_admin()) add_action('wp_enqueue_scripts', 'zg_load_scripts');
function zg_load_scripts(){
wp_enqueue_script("jquery-ui-core");
}
I also tried wp_enqueue_script("jquery-ui-core", null, null, false, false);
in a vain attempt to force it into the header. No dice. What’s going on here?
Why do you need it in the header?
It’s enqueuing in the footer because when it was registered it was set to enqueue in the footer.
In
wp-includes/script-loader.php
:The second line forces it to load in the footer. You could deregister the script, then re-enqueue it in the header: