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

WordPress Trac noreply at wordpress.org
Sat Jan 16 18:20:48 UTC 2021


#19742: WP_Styles should pass more info to the filter
-------------------------------------------------+-------------------------
 Reporter:  ptahdunbar                           |       Owner:  (none)
     Type:  enhancement                          |      Status:  new
 Priority:  normal                               |   Milestone:  Awaiting
                                                 |  Review
Component:  Script Loader                        |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch needs-refresh close        |     Focuses:
  reporter-feedback                              |
-------------------------------------------------+-------------------------
Changes (by hellofromTonya):

 * keywords:  has-patch needs-refresh close => has-patch needs-refresh close
     reporter-feedback


Comment:

 Hello @ptahdunbar,

 I know it's been a lot of years since this ticket was opened. And it's
 marked as a `close` candidate. Before closing it, I want to check with you
 on what you think of @ kovshenin suggestion?

 > 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?

 Does this achieve what you need?

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


More information about the wp-trac mailing list