[wp-trac] [WordPress Trac] #44427: Introduce lazy-loading API for media and other elements
WordPress Trac
noreply at wordpress.org
Wed Apr 10 03:22:16 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: | Focuses:
-----------------------------+------------------------------
Comment (by tabrisrp):
Agreed, and it also simplifies the implementation as no additional
Javascript would be required by default. If adding a shim, it should only
support `IntersectionObserver now`, as it's supported in all modern
browsers now (Safari 12.2 was the last to adopt it).
This also removes the need to brainstorm on data attributes to use to
allow/disable lazyload.
Adding support via `add_theme_support( 'lazy-load-images' );` and
`add_theme_support( 'lazy-load-iframes' );` will allow themes and plugins
developer to provide specific value for any image/iframe handled.
Examples: adding a `loading="eager"` value for the logo in the header for
a theme or the first slide of a slider created with a slider plugin, while
the rest of the slides have the `loading="lazy"` value.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/44427#comment:10>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list