[wp-trac] [WordPress Trac] #50756: Lazy-load iframes
WordPress Trac
noreply at wordpress.org
Fri Nov 6 22:32:48 UTC 2020
#50756: Lazy-load iframes
-------------------------------------------------+-------------------------
Reporter: flixos90 | Owner: flixos90
Type: enhancement | Status: assigned
Priority: normal | Milestone: 5.7
Component: Media | Version:
Severity: normal | Resolution:
Keywords: has-patch has-unit-tests needs-dev- | Focuses:
note |
-------------------------------------------------+-------------------------
Changes (by flixos90):
* keywords: has-patch has-unit-tests => has-patch has-unit-tests needs-
dev-note
* milestone: Future Release => 5.7
Comment:
With https://github.com/WordPress/wordpress-develop/pull/703 I've taken a
first pass on a PR for this, including tests.
The main use-case for iframes in WordPress content today is oEmbed, which
automatically transforms e.g. URLs. Since that filter runs (with priority
8) before `wp_filter_content_tags()` (priority 10) on `the_content`, no
extra thinking was necessary to support those, it just works by adding
`iframe` support to `wp_filter_content_tags()`.
Note that not all oEmbed providers produce server-side `iframe` output.
Furthermore, note that not all oEmbed `iframe` output contains `width` and
`height` attributes which, like for images, are necessary to add a
`loading` attribute in order to avoid content shifting.
cc @azaozz
--
Ticket URL: <https://core.trac.wordpress.org/ticket/50756#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list