A protocol for allowing an embedded representation of a URL on third party sites.

learn more… | top users | synonyms

8
votes
2answers
339 views

When oEmbed fails, display an alternative

I want to specify an alternative image that will be displayed when oEmbed fails. The specific use case is to offer an alternative when China (or other countries) block YouTube. We know the YouTube ...
6
votes
2answers
5k views

how to create a conditional content_width for a wordpress theme?

I'm trying to create a conditional statement for the content width in the functions.php of my theme. So some categories will have a content_width of 580, some will have 900. This will make the oEmbed ...
6
votes
5answers
5k views

WP Oembed not passing through the “autoplay=1” variable

I'm having a problem here: I am passing this through a custom field: http://www.youtube.com/watch?v=E6P1Q-UycHA&autoplay=1 (notice the autoplay=1) But when I load the video on my theme using ...
5
votes
4answers
12k views

How to Replace YouTube Videos with a “Click to Play” Thumbnail?

I use a lot of embedded videos (via oembed) on my blog, and that can slow down page loads. Is there a way to automatically replace YouTube (and other) videos with a thumbnail (preferably the post's ...
5
votes
2answers
3k views

How to wrap oEmbed-embedded video in DIV tags inside the_content?

I am making a Wordpress Theme for a website with video tutorials. I would like to put the video that is embedded in the content (with oEmbed) in a apart div. An example The full content (output from ...
4
votes
3answers
558 views

Modify youtube video size on one page and show another size on different page

I have to display three videos (custom post type) on my first page. When clicking on the link, the post is displayed and video should be in default width. Can you help to find out how to change width ...
4
votes
2answers
3k views

Featured Image of Video from oembed

For Wordpress, I want to auto generate thumb of the video embedded on a page using oembed? And then save it as a featured image of the post. Any idea how to do this?
4
votes
1answer
3k views

oEmbed, thumbnails and wordpress

Wordpress has wp_oembed_get, which I use to get rich media content with embed.ly. I've previously used oEmbed api calls such as this. As you can see it provides thumbnail_url, which I like to use ...
4
votes
1answer
5k views

Apply the_content filter to a custom field with multiple values

I have a custom meta box set up that allows users to paste the Youtube URL of a video so that it can be embedded into a post/page. The meta box can be repeated so that a user can add as few or as ...
4
votes
2answers
456 views

Heartbeat API oEmbed

By default running content through the_content filter automatically checks for oEmbed content. However when returning data through heartbeat_received the filter for oEmbed doesn't seem to work. For ...
4
votes
1answer
960 views

Is it possible to remove height and width attributes from oEmbed video embeds

I was wondering if it's possible to use oEmbed that is built into the core of WP to display video embeds but somehow remove the height and width attritbutes in the output? I know the functions exist ...
4
votes
1answer
135 views

Correct regex for wp_embed_register_handler

THE GOAL I'm trying to parse a url and convert it to an embedded video player in my post's content but I think my regEx is off or I'm not creating a provider correctly. THE CODE Here is what I have ...
4
votes
1answer
724 views

Changing Oembed max width based type of page

How do i change/filter the oembed max width settings (as set by ) admin -> media -> settings -> "Maximum embed size" before the oembed code gets executed. For example on the index pages i want it to ...
4
votes
1answer
773 views

Markup of oEmbed codes in the editor?

Is there a way to give oEmbed codes a special markup in the visual editor? In my dream implementation you paste an oEmbed-enabled url in the editor, which will then automatically replace it with a ...
3
votes
3answers
2k views

Extract the first oembed url inserted on the content of a post

I want to extract the first oEmbed url inserted on the content of a post in order to put in a meta tag from the header, or elsewhere as a way to style it differently from the rest of the content.
3
votes
2answers
653 views

Wordpress refuses to show oembed URL

I need WP to show an embedded representation of a url such as http://domain.com/1121 using oembed. I have setup http://domain.com/1121 with a discovery link: <link href="http://www.domain.com/...
3
votes
2answers
1k views

Set wmode attribute to transparent for the embed shortcode to make drop-down menu hover over YouTube embed in Internet Explorer

When you hover over my drop-down menu using IE8 or IE9, the menu div will display behind the YouTube embedment. It works fine on all other browsers. Upon research, I found out that many others have ...
3
votes
1answer
2k views

How add class youtube and type/html to oembed code?

How can i add : class="youtube-player" type="text/html" to iframe like : function Oembed_youtube_no_title($html,$url,$args){ $url_string = parse_url($url, PHP_URL_QUERY); parse_str($...
3
votes
1answer
423 views

How to add new embed handler not supported by oembed

I am looking to embed videos from websites that do not offer oembed support, but the reference offered on wp codex about wp_embed_register_handler() is just too broad for someone like me. I tried ...
3
votes
1answer
296 views

How can I clear oEmbed caches for YouTube on posts as they are loaded

I have a site with tons of posts hundreds/thousands of which have YouTube videos embedded. Most use the default [embed]youtube_url[embed] format and the actual embed code is stored in the oEmbed ...
3
votes
1answer
941 views

Problems using WP's oembed function + Instagram + AJAX

I am using a modal to load post content via AJAX. Inside the post's template I am using wp_oembed_get() to embed different types of media (YouTube, Vimeo, Flickr, and Instagram). Everything is working,...
3
votes
1answer
2k views

How to oEmbed from custom field, responsive to container size and responsive

I am using Magic Fields 2 to add custom fields/meta boxes. One custom field is for a Vimeo or YouTube video URL to be displayed. The following code oEmbeds the video URL: <?php if (!((...
3
votes
2answers
495 views

How to increase image size returned from Flickr oEmbed in Twenty Twelve theme

I've been using the excellent Flickr Gallery plugin for a while but while upgrading a site to WP3.5 and the Twenty Twelve theme, I stumbled across oEmbeds and notice that Flickr is supported natively. ...
3
votes
1answer
82 views

How to get the oEmbed type (audio, video, image etc.)?

If I embed something with oEmbed, is there a chance to get the type of the embed (video, audio etc.) ? If I look at www.oembed.com I see that in the JSON response there is always the data type. Any ...
3
votes
1answer
127 views

Enqueue script only if page has an oembed

I have a script that adds some styles to OEmbedded content. At the moment its running on every page. I was wondering if anyone knew how to only enqueue the script if the page has an OEmbed on it. I ...
2
votes
2answers
615 views

Adding a wrapper to the youtube embed automatically?

With newer versions of WordPress, YouTube auto oEmbeds. On this particular site I am working on, I need a unique div wrapper around the embedded iframe. I had a look in my functions.php but couldn't ...
2
votes
2answers
2k views

Get all Youtube video's from posts and embed them on a different page

Is this possible? I want to let it check all my posts to see if there is a embedded Youtube video. If so, I want to show that on a different page, embedded and linking to that particular post... I ...
2
votes
2answers
4k views

Get first video from the post (both embed and video shortcodes)

The goal is to grab the first video (embed or shortcode) from the post. So we need to check post content if it has embedded videos ( supported by WP ) or [video] shortcodes. Multiple videos and embeds ...
2
votes
1answer
924 views

Making oEmbed work on the excerpt field

How can I make oEmbed work on the excerpt field so I only have to paste the youtube url in there and then be able to echo 'get_the_excerpt()'? I also want to filter oEmbed and change the wmode but I ...
2
votes
1answer
23 views

Hiding Comments Icon On oembed

I need to hide the comments icon on oEmbed widgets or disable the comments icon feature completely. I've been looking at the following links: https://developer.wordpress.org/reference/files/wp-...
2
votes
1answer
53 views

Getting results from wp_oembed_add_provider

I'm having trouble getting results from wp_oembed_add_provider(). I'm developing a site which needs to embed video content from Facebook, and I came across this handy list of Facebook URL structures. ...
2
votes
1answer
355 views

add oembed provider

I want to add oembed provider to my buddypress activity content I found this function <?php wp_oembed_add_provider( $format, $provider, $regex ); ?> I know I need it to add with init filter ...
2
votes
1answer
125 views

Manipulating oembed_dataparse stopped working for YouTube embeds

My go-to code to manipulate YouTube embeds does not work anymore. Can anyone explain to me what I am doing wrong? This is my code in functions.php // OEMBED FILTER function bolster_oembed_filter( $...
2
votes
1answer
455 views

YouTube oEmbed and privacy-enhanced mode

When you´re embed a youtube video in an iframe, you can enable the privacy-enhanced mode, so YouTube doesn´t store information about your web page visitors until they play the video. I've tried to ...
2
votes
1answer
288 views

Displaying oEmbed errors?

Sometimes embedding an item via oEmbed is not possible, for example when a YouTube video has embedding disabled. The oEmbed service will return a 401 Unauthorized, and the code will not be converted. ...
2
votes
0answers
26 views

Fallback for oEmbed content

Is there any easy way to detect if an oEmbed url is still returning any content? And, if so, is there a way to replace the missing oEmbed content with some kind of fallback content? For instance, if ...
1
vote
1answer
153 views

How to use oEmbeds on Post Content during AJAX requests

I have an AJAX request that returns a post. The post_content has links to Twitter, YouTube, TED and other platforms that are registered as oEmbed providers in a default, vanilla WordPress install. By ...
1
vote
2answers
66 views

Use oEmbed in List Items

I'm aware that WordPress has oEmbed functionality. But the content to be embedded has to be on it's own line like so: Lorem Ipsum http://www.youtube.com/link/to/content More Lorem Ipsum ...
1
vote
2answers
2k views

oEmbed not recognising Vimeo URLs

I am trying to embed a Vimeo video into a post. I am inserting the URL into the page like so. Lorem ipsum dolor sit amet, consectetur adipiscing elit. http//vimeo.com/1234 Lorem ipsum dolor sit ...
1
vote
1answer
248 views

WordPress oEmbed W3C Validation

I recently built a theme that utilises the oEmbed feature in WordPress. Where possible, I like my themes to validate via W3C. The content of the website is driven by Vimeo videos, so I'm getting ...
1
vote
1answer
1k views

How to modify the HTML formatting of an oEmbed link?

I am trying to add oEmbed DeviantArt integration to a custom theme. I found that first step is quite easy, I added wp_oembed_add_provider( 'http://*.deviantart.com/#/d*', 'http://backend....
1
vote
1answer
572 views

OEMBED seems to have stopped working

I had upgraded from 3.0 to 3.1 and oembed worked normally. All of a sudden I've lost embedding when directly pasting video url into the editor. My embed setting is selected under "media". Any ideas ...
1
vote
1answer
154 views

Set first oembed in post to a global variable or function

I have a function that gets the first oembed in the post. I got the code from this related post. add_filter('embed_oembed_html', 'my_function',10,4); function my_function( $cache, $url, $attr, $...
1
vote
1answer
405 views

Display oEmbed in the_excerpt

I am currently adding add_filter('the_excerpt', array($wp_embed, 'autoembed'), 9); to my functions.php file to no avail any other suggestions would be great. Also if I add $content-width to ...
1
vote
2answers
447 views

Use Auto Embed with get_post()

I have PHP script outside the WordPress directory where I'm getting the content of a specific post and now trying to apply the oembed filter on it: include('../wp-load.php'); $thePost = get_post(42, ...
1
vote
1answer
1k views

Embeding YouTube video via a template function throws iframe cross-domain policy error

I'm using Wordpress 3.5 which natively supports embeds into posts and pages from many sites, YouTube included. When I embed a Youtube video directly onto a post or a page (by simply copying and ...
1
vote
2answers
199 views

extra text in Vimeo Embedded videos

For a WordPress site I am working on, there is a jquery slider (based on the coda slider) where videos are presented. All of the videos are from Vimeo. If a video is playing and someone slides to the ...
1
vote
1answer
422 views

Is there a built in function to see if a URLis oEmbed Compatible?

I want to be able to take a url and see if the domain is one of the ones Wordpress supports to add embeds via oEmbed. Is there a built in function that does this in WordPress or would I need to ...
1
vote
1answer
32 views

Disable oEmbed for a Single Shortcode or at Least All Internal Links

Is there any way to disable the oEmbed functionality only for a specific call of the do_shortcode() function in just one script or if that is not possible can it be disabled for all the internal links ...
1
vote
1answer
28 views

Video Embed with Captions in Turkish

I normally embed videos by directly writing the URL in the WP built in [embed] code. Like: [embed]https://www.youtube.com/watch?v=p_o4aY7xkXg[/embed] But now I want this video to open automatically ...