[wp-trac] [WordPress Trac] #58893: Introduce filter to modify/override attributes returned by `wp_get_loading_optimization_attributes()`

WordPress Trac noreply at wordpress.org
Mon Jul 24 18:47:18 UTC 2023


#58893: Introduce filter to modify/override attributes returned by
`wp_get_loading_optimization_attributes()`
-------------------------+-------------------------
 Reporter:  flixos90     |      Owner:  (none)
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  6.4
Component:  Media        |    Version:
 Severity:  normal       |   Keywords:  2nd-opinion
  Focuses:  performance  |
-------------------------+-------------------------
 The `wp_get_loading_optimization_attributes()` function introduced in 6.3
 (see #58235) provides a central place to get loading optimization
 attributes for specific elements/tags.

 Currently, it is impossible for plugins to customize that logic, which is
 a limitation given that plugins may use alternative ways that e.g. can
 predict in-viewport elements or the LCP element more reliably than
 WordPress core.

 A filter should be introduced that allows to change the returned
 attributes: Either before returning the attributes array, or alternatively
 as a short-circuit filter - or potentially both? Let's discuss.

 This ticket's implementation should be considered blocked by #58891 as
 making the changes before that would be unnecessarily complicated and
 error-prone.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/58893>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list