[wp-hackers] Include popular libs with a function

Peter Westwood peter.westwood at ftwr.co.uk
Sat Aug 19 16:04:09 GMT 2006


On 18 Aug 2006, at 22:38, Sean Hickey wrote:

> After looking through the source code, it seems like this solution
> doesn't fully satisfy my original request, which is to include JS libs
> that would be beneficial to plugin developers, not just libs that WP
> uses.
>
> You're now including Prototype, which is cool, but you seem to be
> including it mostly because WP now uses it.  I'd also like to see libs
> like Scriptaculous, Dojo, etc included.  It doesn't matter if WP
> itself never uses them.  What matters is they are already there for
> plugin developers to use.

I don't think we should be including anything we don't use.

There is nothing stopping a plugin author using the builtin script  
loading functions in 2.1 to add these other libs in the same way the  
included ones are so that if more than one plugin uses the same  
library it only gets output once by the script loader.

e.g.

wp_enqueue_script('dojo', '/wp-content/plugins/myplugin/dojo.js',  
false, '0.01');

Which will register the script with the script loaded and enqueue it  
for output.

westi
-- 
http://blog.ftwr.co.uk




More information about the wp-hackers mailing list