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

WordPress Trac noreply at wordpress.org
Wed Aug 17 00:25:52 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 peterwilsoncc):

 Replying to [comment:67 azaozz]:
 > 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.

 If the function is added, maybe check if the `wp_head` action has fired
 and log a notice if that is the case.

 I realise there is `wp_preload_resources` within `wp_preload_resources()`
 but I can see how a plugin developer may wish to use those in combination
 to add `Link` HTTP headers.

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


More information about the wp-trac mailing list