I’m creating a plugin that uses mootools.js. I do not want multiple instances of the script installed on a user’s site, if I am able to avoid it. What is the best way to check if mootools.js is already a loaded script?
1 comment
Comments are closed.
wp_script_is()
would tell you is the script is enqueued but you’d need to know the handle.If you really need to know if the script is enqueued you will probably have to crawl the
$wp_scripts
global for the actual file name.Try:
That will dump a huge object but the information you need is in there.