[wp-hackers] wp-config.php, wp-load.php, and ABSPATH

Stephen Rider wp-hackers at striderweb.com
Wed Sep 16 18:46:07 UTC 2009


On Sep 16, 2009, at 10:03 AM, Otto wrote:

>> P.S. -- In all of this, I'm not sure I've ever heard a satisfactory
>> explanation for WHY all these things should be enqueued anyway.
>>  Dependencies, sure, but why for a stylesheet or script that  
>> doesn't have
>> any dependencies?
>
> Duplication prevention. If you enqueue the same script (by identifier)
> multiple times from multiple plugins, it will still only output the
> script link once. If you tried to output it twice, then it'd cause a
> page error, most likely, since it'd be trying to redefine functions.

Great info all around, Otto.  Thanks for this.

New Question:  Plugin A includes some JavaScript library or whatever  
and enqueues it as "xyz".  Plugin B includes the same library and also  
enqueues it as "xyz".  Okay, through the magic of code there is no  
duplication.  But what happens if Plugin A has an older version of the  
library?  If that gets loaded then Plugin B is stuck with the older  
version.  Is there a way to avoid that?  A way to ensure the newer  
version loads?

(Frankly, it would be cool if there were a way to enqueue a PHP  
library as well....)

Stephen


More information about the wp-hackers mailing list