[wp-trac] [WordPress Trac] #50756: Lazy-load iframes

WordPress Trac noreply at wordpress.org
Wed Dec 16 21:17:40 UTC 2020


#50756: Lazy-load iframes
-------------------------------------------------+-------------------------
 Reporter:  flixos90                             |       Owner:  flixos90
     Type:  enhancement                          |      Status:  closed
 Priority:  normal                               |   Milestone:  5.7
Component:  Media                                |     Version:
 Severity:  normal                               |  Resolution:  fixed
 Keywords:  has-patch has-unit-tests needs-dev-  |     Focuses:
  note                                           |
-------------------------------------------------+-------------------------
Changes (by flixos90):

 * status:  assigned => closed
 * resolution:   => fixed


Comment:

 In [changeset:"49808" 49808]:
 {{{
 #!CommitTicketReference repository="" revision="49808"
 Media: Enable lazy-loading of iframes by adding the `loading="lazy"`
 attribute to iframe tags on the front-end.

 * Expands the capabilities of `wp_filter_content_tags()` to add the
 attribute to iframe tags if enabled.
 * Modifies the default behavior of `wp_lazy_loading_enabled()` so that it
 returns `true` for `iframe` tags.
 * Introduces a `wp_iframe_tag_add_loading_attr()` function.
 * Introduces a `wp_iframe_tag_add_loading_attr` filter.

 Like for images, the attribute is only added to iframes which have both
 `width` and `height` specified (see related #50367).

 Props azaozz, flixos90, westonruter.
 Fixes #50756.
 }}}

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


More information about the wp-trac mailing list