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

Allow for oEmbed fallback (using OpenGraph tags) #44881

Open
TimBroddin opened this issue Oct 11, 2022 · 3 comments
Open

Allow for oEmbed fallback (using OpenGraph tags) #44881

TimBroddin opened this issue Oct 11, 2022 · 3 comments
Labels
[Block] Embed Affects the Embed Block [Type] Enhancement A suggestion for improvement.

Comments

@TimBroddin
Copy link
Contributor

What problem does this address?

Currently when pasting a link that doesn't support oEmbed embedding, an error is shown, and the option to convert to a normal link is proposed

CleanShot 2022-10-11 at 20 11 45@2x

What is your proposed solution?

I like the way Medium handles this. It fetches the OpenGraph tags and makes a nice card.

CleanShot 2022-10-11 at 20 13 04@2x

Right now the embed block calls the oEmbed endpoint (/wp-json/oembed/1.0/proxy). It would make sense to call another API endpoint (for example /wp-json/opengraph/1.0/proxy) when this fails, which would return the relevant OpenGraph tags (title, description, image) needed to build the card.

@talldan talldan added [Type] Enhancement A suggestion for improvement. [Block] Embed Affects the Embed Block labels Oct 12, 2022
@Mamaduka
Copy link
Member

The core already has an API for parsing the site metadata. Currently, it's used to generate URL details popups. We can probably adopt that into an embed provider.

I started experimenting with a similar concept a few years ago - https://wordpress.org/plugins/bookmark-card/.

@TimBroddin
Copy link
Contributor Author

@Mamaduka thanks for linking to your plugin. It does exactly what I'm talking about.

It would be such an improvement to the UX if we could bring something like that to core.

@kohheepeace
Copy link

There is a open PR #47765 to add card link.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Embed Affects the Embed Block [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

4 participants