[wp-hackers] Hook into load-styles.php / load-scripts.php "queue"?

Otto otto at ottodestruct.com
Tue Dec 1 21:34:31 UTC 2009


Actually, upon a further reading through the code, I see that it does
a check such that only scripts in the default directories get handled
in this manner. These would be the scripts in /wp-admin/js/ and
/wp-includes/js/ dirs. I didn't know it did that, though I can see
why...

To get your own scripts to get handled in this way, you'd need to
modify the $scripts variable. It would look something like this:

function my_scripts_adjuster( &$scripts ) {
$scripts->default_dirs[] = '/path/from/wp/root/to/my/dir/';
}
add_action( 'wp_default_scripts', 'my_scripts_adjuster',20);

I think that would do the trick.

-Otto
Sent from Memphis, TN, United States


On Tue, Dec 1, 2009 at 3:29 PM, Nathan Rice <ncrice at gmail.com> wrote:
> Out of curiosity, why aren't scripts minified using load_scripts.php when
> using wp_enqueue_script in a theme?
>
> ------------------
> Nathan Rice
> WordPress and Web Development
> www.nathanrice.net | twitter.com/nathanrice


More information about the wp-hackers mailing list