[wp-trac] [WordPress Trac] #59421: loading="lazy" attribute is not applied at all

WordPress Trac noreply at wordpress.org
Thu Sep 21 08:22:40 UTC 2023


#59421: loading="lazy" attribute is not applied at all
---------------------------------------+------------------------------
 Reporter:  lovor                      |       Owner:  (none)
     Type:  enhancement                |      Status:  new
 Priority:  normal                     |   Milestone:  Awaiting Review
Component:  General                    |     Version:  6.3.1
 Severity:  minor                      |  Resolution:
 Keywords:  needs-patch needs-testing  |     Focuses:
---------------------------------------+------------------------------
Changes (by lovor):

 * type:  defect (bug) => enhancement


Comment:

 After going superficially through the code in media.php, I understood that
 only the fourth and subsequent images get loading="lazy" attribute, which
 is not stated in any docs. I will change this to "enhancement" with
 following suggestions:
 - describe in docs **exact** method how it functions
 - change algorithm to take into account image heights and widths to
 calculate what is above and below the fold - for screen size the most used
 screen dimension would be taken

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


More information about the wp-trac mailing list