[wp-trac] [WordPress Trac] #59550: Attribute "loading" with value "lazy" is missing

WordPress Trac noreply at wordpress.org
Fri Oct 6 08:14:04 UTC 2023


#59550: Attribute "loading" with value "lazy" is missing
-------------------------------+------------------------------
 Reporter:  r3dluke            |       Owner:  joemcgill
     Type:  defect (bug)       |      Status:  reviewing
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  Media              |     Version:  6.3
 Severity:  normal             |  Resolution:
 Keywords:  reporter-feedback  |     Focuses:
-------------------------------+------------------------------

Comment (by r3dluke):

 Replying to [comment:1 joemcgill]:
 > Hi @r3dluke, welcome to Trac. There have indeed been intentional changes
 to the way WordPress applies lazy loading to images since 6.3. For a full
 explanation of the changes, you can see
 https://make.wordpress.org/core/2023/07/13/image-performance-enhancements-
 in-wordpress-6-3/.
 >
 > Thank you for pointing out the confusion with the documentation for
 `wp_get_attachment_image()`. You are correct that this is now not always
 accurate, depending on the context for which that function is called.
 >
 > To better understand whether you are experiencing unexpected behavior,
 it would be useful to better understand the context where you are using
 that function and expecting lazy loading to automatically be applied.


 Hello Joe,
 thanks for your feedback. We use the function almost in all places where
 we need an image tag containing srcset and all the attributes. Our theme
 is object-oriented and component based. If you take a look at
 https://meisterplan.com/ you'll see a testimonial slider at the bottom of
 the page. When updating to WordPress 6.3 (and above), images in this
 slider will be loaded already at the top of the page because the
 loading="lazy" is now missing and I would have to add the attribute
 manually via the atts array.

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


More information about the wp-trac mailing list