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

Oliver Schlöbe office at wpseek.com
Tue Dec 1 21:44:43 UTC 2009


Wow, thanks a bunch!

Will try that.

Regards,
Oliver


On 01.12.2009 22:34, Otto wrote:
> 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
>>      
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>
>
>    

-- 
Regards,
Oliver Schlöbe

http://wpseek.com/
http://wpworldmap.net/



More information about the wp-hackers mailing list