Problem with oEmbed in some themes

For interested parties. Solution of my (and maybe similar problems) was to check headers of oembed feed. I didn’t notice that my headers where little different that in RFC 🙂 Fixing them helped me with my problem.

How to oEmbed MySite in WordPress

I think your oEmbed implementation is wrong. You can see in the WP-oEmbed class that WordPress supports four type values: photo, video, link and rich; whereas you’re returning type=image. From the spec section 2.3.4 it looks like that’s WordPress’s list is complete and ‘image’ isn’t generally supported. You possibly meant type=photo, but those aren’t generally … Read more

Applying an oEmbed filter to a custom post type

After looking at the code reference for wp_oembed_get (and WP_oEmbed::get_html()) I don’t think embed_oembed_html fitler gets fired when that function is called. But I might have missed something. You could try using WP_Embed::shortcode( array $attr, string $url=”” ) instead of wp_oembed_get as this would mimic what happens with the native post types and the filter … Read more

oEmbed not recognising Vimeo URLs

Looking into WordPress Core vimeo is registered like so: ‘#http://(www\.)?vimeo\.com/.*#i’ => array( ‘http://www.vimeo.com/api/oembed.{format}’, true ), But looking at vimeo API for oEmbed they show their URL without the www. so what you need to do is register vimeo oEmbed correctly: add_action( ‘init’, ‘add_vimeo_oembed_correctly’ ); function add_vimeo_oembed_correctly() { wp_oembed_add_provider( ‘#http://(www\.)?vimeo\.com/.*#i’, ‘http://vimeo.com/api/oembed.{format}’, true ); } You can … Read more

OEMBED seems to have stopped working

It appears I’ve been hoodwinked by my local setup & accidentally stopping connections to vimeo / youtube. This resulted in the video url appearing as only text. Once my setup was restarted everything appears to be working properly. Sorry for the confabulation.

How to modify the HTML formatting of an oEmbed link?

WP_oEmbed::data2html() has a filter, oembed_dataparse. You can use this to change the output, based on the extra data which is passed as the second parameter. Something like this for example: add_filter( ‘oembed_dataparse’, ‘wpse17461_oembed_dataparse’, 10, 3 ); function wpse17461_oembed_dataparse( $html, $data, $url ) { if ( FALSE !== strpos( $url, ‘deviantart.com’ ) ) { return $html … Read more