[wp-trac] [WordPress Trac] #44427: Introduce lazy-loading API for media and other elements

WordPress Trac noreply at wordpress.org
Tue May 21 12:30:05 UTC 2019


#44427: Introduce lazy-loading API for media and other elements
------------------------------------------+------------------------------
 Reporter:  mor10                         |       Owner:  (none)
     Type:  feature request               |      Status:  new
 Priority:  normal                        |   Milestone:  Awaiting Review
Component:  Media                         |     Version:
 Severity:  normal                        |  Resolution:
 Keywords:  needs-patch needs-unit-tests  |     Focuses:  performance
------------------------------------------+------------------------------
Changes (by spacedmonkey):

 * keywords:   => needs-patch needs-unit-tests
 * focuses:   => performance


Comment:

 I have create an [https://github.com/WordPress/gutenberg/issues/15753
 issue] on the github repo for gutenberg for this.

 I think we can get this in WP 5.3.

 Developers can start playing with this attribute with a filter as simple
 as this.
 {{{#!php
 add_filter( 'wp_get_attachment_image_attributes', function( array $attr )
 {
         $attr['loading'] = 'lazy';
         return $attr;
 });
 }}}

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


More information about the wp-trac mailing list