Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wp-embed-aspect class not working well in Youtube block #4040

Closed
rodica-andronache opened this issue Jul 19, 2023 · 2 comments
Closed

wp-embed-aspect class not working well in Youtube block #4040

rodica-andronache opened this issue Jul 19, 2023 · 2 comments
Assignees
Labels
bug This label could be used to identify issues that are caused by a defect in the product. customer report Indicates the request came from a customer. small (1-3h) This label is used for issues that can be completed within 3 hours or less.

Comments

@rodica-andronache
Copy link
Contributor

Description

In the Youtube block, you can change the aspect ration of the video using the wp-embed-aspect class, but in Neve this does not work.
https://wordpress.org/support/topic/neve-theme-takes-over-youtube-native-embed-and-breaks-flexibilty-of-ratio-for-sh/

Step-by-step reproduction instructions

  1. Create a post with the Youtube block
  2. Add a video and go to Advanced > ADDITIONAL CSS CLASS(ES) and try to change the wp-embed-aspect class.
  3. The aspect ration does not apply in frontend ( This works well in 2023 theme, for example )

Screenshots, screen recording, code snippet or Help Scout ticket

https://vertis.d.pr/v/x1xCSt

Environment info

No response

Is the issue you are reporting a regression

No

@rodica-andronache rodica-andronache added the bug This label could be used to identify issues that are caused by a defect in the product. label Jul 19, 2023
@pirate-bot pirate-bot added the customer report Indicates the request came from a customer. label Jul 19, 2023
@cristian-ungureanu cristian-ungureanu added the small (1-3h) This label is used for issues that can be completed within 3 hours or less. label Aug 9, 2023
@cristian-ungureanu
Copy link
Contributor

Hey @rodica-andronache, after doing a bit of research here's what I found:

The Gutenberg embed block supports adding responsive wrappers around embeds that are cognizant of the embed's aspect ratio. 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 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.

source: https://core.trac.wordpress.org/ticket/54468

In other words, this feature will only work for FSE themes.

@rodica-andronache
Copy link
Contributor Author

@cristian-ungureanu ok, got it, indeed it seems to works just in FSE themes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This label could be used to identify issues that are caused by a defect in the product. customer report Indicates the request came from a customer. small (1-3h) This label is used for issues that can be completed within 3 hours or less.
Projects
None yet
Development

No branches or pull requests

3 participants