[wp-trac] [WordPress Trac] #19742: WP_Styles should pass more info to the filter

WordPress Trac noreply at wordpress.org
Mon Dec 3 15:11:20 UTC 2012


#19742: WP_Styles should pass more info to the filter
-------------------------+------------------------------
 Reporter:  ptahdunbar   |       Owner:
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  Awaiting Review
Component:  General      |     Version:
 Severity:  normal       |  Resolution:
 Keywords:  has-patch    |
-------------------------+------------------------------

Comment (by kovshenin):

 Hey, just stumbled across this. You have the handle which is a unique ID,
 and you can get all the info you need by calling `$wp_styles->query()` or
 `->get_data()` if you need the extras. Does that solve your problem?

 Would it be much easier if the `rel` attribute was filterable, say
 `style_loader_rel` or maybe even `style_loader_rel-$handle` so you could:

 {{{
 add_filter( 'style_loader_rel-my-script', function() { return
 'stylesheet/less'; } );
 wp_enqueue_script( 'my-script', ... );
 }}}

 Thoughts?

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/19742#comment:1>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list