[wp-trac] [WordPress Trac] #59577: Images in block templates or patterns do not have loading optimization attributes

WordPress Trac noreply at wordpress.org
Wed Jan 17 18:19:08 UTC 2024


#59577: Images in block templates or patterns do not have loading optimization
attributes
-------------------------------------------+--------------------------
 Reporter:  flixos90                       |       Owner:  flixos90
     Type:  defect (bug)                   |      Status:  assigned
 Priority:  normal                         |   Milestone:  6.5
Component:  Media                          |     Version:
 Severity:  normal                         |  Resolution:
 Keywords:  needs-patch reporter-feedback  |     Focuses:  performance
-------------------------------------------+--------------------------

Comment (by flixos90):

 @joemcgill I tried to clarify that in the last paragraph of this ticket.

 #59464 is about images hard-coded in template files missing dimension
 attributes. Fixing that would still leave some of those images without the
 image optimization attributes, due to the problem this ticket covers.

 This ticket is about `wp_filter_content_tags()` not adding any image
 optimization attributes (like `fetchpriority` and `loading`) to images
 that belong to the overarching template (regardless of whether that
 template comes from a file or from user-generated content in the
 database).

 The reason for that bug is that the `template` context is used for those
 images and that context is immediately skipped from any further
 processing. The original rationale for that was to avoid double processing
 images (related: #55996) - but it ignores the scenario where there are
 images as part of the template itself and thus those wouldn't have been
 processed as part of another context.

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


More information about the wp-trac mailing list