late answer
From a brief look:
You’d have to use
include( admin_url().'load-scripts.php' );
- and
include( admin_url().'script-loader.php' );
Then jump into $GLOBALS['wp_scripts']
:
Use…
$wp_scripts->default_dirs( array_merge(
$wp_scripts->default_dirs
,array( '/themes/your_theme/js/' )
);
…to extend it.
And then use
$wp_scripts->add( $handle, $path_from_content_dir, false/array( $deps ), $ver )
to add a script.
Notes:
- Uncompressed scripts get searched by
.dev.js
(whenSCRIPT_DEBUG
isTRUE
). - Same seems to be possible for
$wp_styles
. - EDIT: WP 3.5 will change this behavior and use
.js
for “dev” versions and “.min.js” when (SCRIPT_DEBUG
isTRUE
);
(But I guess this will only work if you use a plugin or mu-plugin.)
It´s not tested and I´m not shure if this will work.