[wp-trac] [WordPress Trac] #32607: Function for URL to registers scripts and styles

WordPress Trac noreply at wordpress.org
Mon Jun 15 22:13:08 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:  has-patch        |     Focuses:
-----------------------------+------------------------------
Changes (by tyxla):

 * keywords:   => has-patch


Comment:

 Here is an example usage with the functions from my patch:

 {{{
 // registering a script
 wp_register_script( 'handle', 'http://example.com', array( 'test-dep' ), 1
 );

 // retrieving various details for the 'handle' script
 $script = wp_get_registered_script( 'handle' );
 echo $script->src; // script URL
 echo $script->ver; // script version
 }}}

 So this way you could easily retrieve the entire script/style dependancy
 object, and quickly get the URL, version, dependancies or anything else
 from it.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/32607#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list