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

Add embed responsive div only to Tainacan related embeds! #537

Closed
mateuswetah opened this issue May 6, 2021 · 1 comment
Closed

Add embed responsive div only to Tainacan related embeds! #537

mateuswetah opened this issue May 6, 2021 · 1 comment
Milestone

Comments

@mateuswetah
Copy link
Member

mateuswetah commented May 6, 2021

Our current use of embed_oembed_html filter:

add_filter('embed_oembed_html', [$this, 'responsive_embed'], 10, 3);

Wraps every embeded element with a .tainacan-embed-container div, which might cause conflicts especially if a theme is using the new responsive-embeds support option. We should find a way to have this used only in situations related to plugin. A suggestion made so far was to have a filter by the_content...

also, check this discussion in portuguese:
https://tainacan.discourse.group/t/conflito-de-estilos-em-elementos-embed/79/15

@mateuswetah mateuswetah created this issue from a note in tainacan/tainacan (Backlog) May 6, 2021
@mateuswetah
Copy link
Member Author

In any case, we should also improve our own embed responsiveness class... There are a lot of things being assumed on CSS that are not safe for the diversity of content that can be rendered.

I was investigating if maybe we could use Gutenberg blocks in somehow to display our content, as they work very well. Maybe if we can not make this "programmatically", we could just learn from their code. They check the iframes height and width attributes to decide among classes that handle the ratio properly (so not only for YouTube):

https://github.com/WordPress/gutenberg/blob/baffdc7f880e5e9b68d7cb38fd17758f3e0c2bbd/packages/block-library/src/embed/constants.js#L1

https://github.com/WordPress/gutenberg/blob/baffdc7f880e5e9b68d7cb38fd17758f3e0c2bbd/packages/block-library/src/embed/util.js#L183

@mateuswetah mateuswetah moved this from Backlog to To Do in tainacan/tainacan May 14, 2021
@vnmedeiros vnmedeiros added 0.18.1 and removed 0.18 labels Jun 7, 2021
@mateuswetah mateuswetah added 0.18.4 and removed 0.18.3 labels Jul 13, 2021
@vnmedeiros vnmedeiros added this to the v0.18 milestone Aug 13, 2021
@mateuswetah mateuswetah moved this from To Do to In Progress in tainacan/tainacan Dec 8, 2021
@mateuswetah mateuswetah moved this from In Progress to Validation in tainacan/tainacan Dec 8, 2021
tainacan/tainacan automation moved this from Validation to Done Jan 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

No branches or pull requests

2 participants