[wp-hackers] Included scripts array

Jennifer Hodgdon yahgrp at poplarware.com
Thu Aug 7 14:56:25 GMT 2008


Take a look at the wp_enqueue_scripts and wp_print_scripts functions. 
Basically, the list of scripts to be printed is maintained in the global 
variable $wp_scripts. You can probably figure out what those functions 
do, and do something similar to figure out if the script of interest to 
you has been queued previously. Files to look at (in wp-includes): 
class.wp-scripts.php, class.wp-dependencies.php, functions.wp-scripts.php.

However, you really need to get the script into the HTML header if you 
want it to work right in all browsers, so this probably won't help you 
much....

Good luck,
     Jennifer


scribu wrote:
> I was wondering if after the various js scripts are printed to <head>
> there is an array of them that I can acces later in the page.
> 
> I'm trying to load jQuery and other scripts only if needed (hence I
> can't use wp_enqueue_script) and I don't want to load it if it is
> already in the head.
> 



More information about the wp-hackers mailing list