[wp-trac] [WordPress Trac] #32607: Function for URL to registers scripts and styles
WordPress Trac
noreply at wordpress.org
Mon Jun 15 22:11:25 UTC 2015
#32607: Function for URL to registers scripts and styles
-----------------------------+------------------------------
Reporter: msnewton | Owner:
Type: feature request | Status: new
Priority: normal | Milestone: Awaiting Review
Component: General | Version:
Severity: normal | Resolution:
Keywords: | Focuses:
-----------------------------+------------------------------
Comment (by tyxla):
Hi @msnewton and welcome to the WordPress Core Trac!
This sounds like a good idea IMHO. I've personally had to locate the URL
or version of a registered script several times and I always had to use
the global variables `$wp_scripts` for these instances.
So, it might be useful to be able to quickly find the URL, version or
dependancies of a style/script that has been registered.
The functions for that can simply return the `_WP_Dependency` object
(containing `handle` - script/style name, `src` - URL, `deps` -
dependancies, `ver` - version, etc.), or `false` if the script/style
hasn't been registered.
I'll attach a patch for these functions in a minute.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/32607#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list