WordPress.org

Make WordPress Core

Opened 7 years ago

Closed 7 years ago

#30602 closed feature request (wontfix)

Add provider_name as CSS class when using oEmbed

Reported by: cliffpaulick Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Embeds Keywords:
Focuses: Cc:

Description

Idea: add oEmbed's provider_name as a CSS class

Example:

oEmbed Link:
http://vimeo.com/7100569

Response:
http://vimeo.com/api/oembed.xml?url=http%3A//vimeo.com/7100569

Current Result:

<iframe src="//player.vimeo.com/video/7100569" width="500" height="281" frameborder="0" title="Brad!" webkitallowfullscreen="" mozallowfullscreen="" allowfullscreen=""></iframe>

Proposed Result:

<iframe class="vimeo" src="//player.vimeo.com/video/7100569" width="500" height="281" frameborder="0" title="Brad!" webkitallowfullscreen="" mozallowfullscreen="" allowfullscreen=""></iframe>

Change History (4)

#1 @nacin
7 years ago

Per the oEmbed spec, we just use whatever comes back from the oEmbed provider. Trying to modify the HTML is potentially dangerous, lossy, and wouldn't be able to catch everything (it's not always an iframe or a single element like audio or video, for example).

#2 follow-up: @cliffpaulick
7 years ago

Understood. Is there a filter you'd suggest using if I want to do it anyway?

Thanks for any help.

#3 in reply to: ↑ 2 @Viper007Bond
7 years ago

Replying to cliffpaulick:

Understood. Is there a filter you'd suggest using if I want to do it anyway?

oembed_dataparse in source:/trunk/src/wp-includes/class-oembed.php

Theoretically we could wrap the result in a div and give that a class but potentially that could break some things, especially if the oEmbed endpoint was returning plain text or something.

#4 @helen
7 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to wontfix
  • Status changed from new to closed

Just a friendly note to be careful with what you're doing with that CSS targeting - some oEmbed providers (Twitter, notably) are very strict about adhering to their display guidelines. In any case, not something we should do in core.

Note: See TracTickets for help on using tickets.