[wp-trac] [WordPress Trac] #42438: Add support for preload links (similar to resource hints)

WordPress Trac noreply at wordpress.org
Tue Aug 16 18:54:19 UTC 2022


#42438: Add support for preload links (similar to resource hints)
-------------------------------------------------+-------------------------
 Reporter:  nico23                               |       Owner:  swissspidy
     Type:  enhancement                          |      Status:  closed
 Priority:  normal                               |   Milestone:  6.1
Component:  Script Loader                        |     Version:  4.9
 Severity:  normal                               |  Resolution:  fixed
 Keywords:  has-unit-tests has-patch commit      |     Focuses:
  needs-dev-note                                 |  performance
-------------------------------------------------+-------------------------

Comment (by azaozz):

 Replying to [comment:66 adamsilverstein]:
 > For a more declarative API, thinking something like...

 It would be nice to have `wp_add_preload_resources()` but I'm not a fan of
 globals. It is the (very) old way of doing things and has many drawbacks.
 For example some plugin may start manipulating the global directly. Then
 if core decided to fix or change something, it will fail.

 Also this will fail if `wp_add_preload_resources()` is used after
 `wp_preload_resources()`, and the plugin using it will not even know.
 Worth mentioning in the docblock at least.

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


More information about the wp-trac mailing list