Is it possible to include jQuery UI as a whole instead of:
wp_enqueue_script('jquery-ui-core');
wp_enqueue_script('jquery-effects-core');
// a lot of other jquery ui imports....
I’ve searched in the codex and was able to find the full list of included scripts, but could not find a way to include the full jQuery UI version as one import like:
wp_enqueue_script('jquery-ui');
Sources:
http://codex.wordpress.org/Function_Reference/wp_enqueue_script
If you take a look at registrations in source there is no alias to load all of jQuery UI in bulk available and WP core itself uses pieces as dependencies individually.
You could create and use such alias yourself (registered script handle with no URL and all of needed scripts as dependencies), but it might be overkill – there are a lot of scripts there to load.
You can filter out all jQuery UI scripts from the global
$wp_scripts
:This could theoretically be used to enqueue them or build the alias @rarst suggested.
Just include the pieces you actually need. It will handle the dependencies for you.
For example, if you needed jquery-ui-dialog, then you can just enqueue that one and it will then go and automatically add jquery-ui-resizable, jquery-ui-draggable, jquery-ui-button, jquery-ui-position, jquery-ui-core, jquery-ui-mouse, jquery-ui-widget, and jquery all by itself.
You should enqueue just the scripts you need, and it will add in the script dependencies. You don’t need to worry about picking which ones to enqueue. For example, if you want to include the scripts required for the Accordion widget, just add the following snippet and it will load all the dependencies too (jQuery, jQuery-UI core, jQuery widget).
If what you want to do is load them all as a single minified resource, install Use Google Downloads plugin. It will load the appropriate version from the Google CDN, minified and served with gzip compression and a long expiry time.