[wp-trac] [WordPress Trac] #58089: Featured images within post content cause lazy-loading logic to apply incorrectly

WordPress Trac noreply at wordpress.org
Fri Jul 7 18:07:05 UTC 2023


#58089: Featured images within post content cause lazy-loading logic to apply
incorrectly
-------------------------------------------------+-------------------------
 Reporter:  flixos90                             |       Owner:  flixos90
     Type:  defect (bug)                         |      Status:  closed
 Priority:  high                                 |   Milestone:  6.3
Component:  Media                                |     Version:  5.9
 Severity:  normal                               |  Resolution:  fixed
 Keywords:  has-patch has-unit-tests needs-dev-  |     Focuses:
  note                                           |  performance
-------------------------------------------------+-------------------------

Comment (by flixos90):

 In [changeset:"56164" 56164]:
 {{{
 #!CommitTicketReference repository="" revision="56164"
 Media: Avoid programmatically created images within post content from
 incorrectly receiving `fetchpriority="high"`.

 Follow-up to [56037], as that changeset accidentally did not consider the
 changes made in [55825]: Images that are programmatically injected into
 post content (e.g. through a block, or shortcode, or any hook calling a
 function like `wp_get_attachment_image()`) must be treated as part of the
 whole post content blob since otherwise the heuristics for applying
 `fetchpriority="high"` and `loading="lazy"` are skewed by parsing certain
 images before others rather than sequentially parsing the entire post
 content. [55825] addressed that for lazy-loading, but when [56037]
 introduced `fetchpriority` support, the related refactor missed making the
 same consideration for that attribute.

 Props flixos90, spacedmonkey, thekt12, mukesh27.
 Fixes #58235.
 See #58089.
 }}}

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


More information about the wp-trac mailing list