[wp-trac] [WordPress Trac] #54468: Apply aspect ratio classes to wp_oembed_get when theme_supports('responsive-embeds') is added
WordPress Trac
noreply at wordpress.org
Thu Nov 18 19:37:38 UTC 2021
#54468: Apply aspect ratio classes to wp_oembed_get when theme_supports
('responsive-embeds') is added
-------------------------+-----------------------------
Reporter: eclev91 | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Embeds | Version: trunk
Severity: normal | Keywords:
Focuses: |
-------------------------+-----------------------------
The Gutenberg embed block supports [adding responsive wrappers around
embeds that are cognizant of the embed's aspect
ratio](https://github.com/WordPress/gutenberg/blob/v11.9.1/packages/block-
library/src/embed/util.js#L185). Without creating fixed-width columns, the
embed will fill its container at the interpreted aspect ratio.
If you're still writing PHP templates, you're using wp_oembed_get, which
does not support this. [This
ticket](https://core.trac.wordpress.org/ticket/34928) suggests that some
JS fires to adjust the height on iframes on window resize, but that's a
somewhat different issue, becoming important after the embed has been
rendered. That ticket also suggests that an embed expanding to fill its
container is undesirable and not in-line with oEmbed's specification, but
whoever designed the Gutenberg block must have had a different
interpretation of that spec.
Would be great if WordPress oEmbeds behaved the same however you create
them.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/54468>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list