Questions tagged [oembed]

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

Filter by
Sorted by
Tagged with
1 vote
1 answer
192 views

Why is my oembed function modifying Twitter embed?

Building a theme with Boostrap 4 and WordPress 5.0.1. Under Bootstrap's documentation for embed video the following format is required for responsive videos: <div class="embed-responsive embed-...
user9447's user avatar
  • 1,772
0 votes
0 answers
144 views

Modify oembed code conditionally

My users have sprung a requirement on me that I am having some difficulty figuring out. I've tied myself up in knots trying to unravel the the logic needed. The original spec of this website I am ...
Burgi's user avatar
  • 373
2 votes
1 answer
2k views

Filter oembeds tags to modify iframe attributes

By default, when putting another WP url inside a post/page, it oEmbeds it and produces a blockquote and iframe code with the default in the front-end: <iframe class="wp-embedded-content" sandbox="...
Carl Alberto's user avatar
  • 1,067
0 votes
1 answer
294 views

Load oEmbed iframe within ajax call

I'm trying to load oembed shortcode loaded via ajax. The problem is that the oembed shortcode seems to work as I have a blockquote instead of the instagram link. However the blockquote is not ...
leopold_pepichoc's user avatar
1 vote
2 answers
959 views

Instagram URL is converted into oEmbed

I have 8 Instagram URLs in this post out of which 3 are not converted into embed/iframes. I'm using Gutenberg's Instagram embed blog to add the URL's.https://blog.wwf.sg/ocean/2018/11/netflix-...
Manoj H L's user avatar
  • 135
2 votes
1 answer
411 views

wp_embed_register_handler to embed html files

I am creating a new Wordpress website that will contain thousands of online books and articles to read, in addition to other media, like videos. I don't want to bloat my database by pasting tens of ...
Atef Wagih's user avatar
0 votes
1 answer
248 views

How to make enqueue_embed_scripts work with the embed_template filter

I am currently trying to customize the display of my posts that gets embedded on other sites. I am able to have my custom template file through the embed_template filter but I can't successfully ...
Jeda Dragon's user avatar
1 vote
0 answers
45 views

How to change the oembed "type"?

By default the oEmbed type of my wordpress posts is "rich", but I want to convert it to "Video". I spent 2+ hours trying to find the answer but with no luck, is it possible?
kinx's user avatar
  • 123
1 vote
0 answers
1k views

oEmbed not working in WordPress

I am using custom embed URL for embedding a video. Embedding Youtube and Vimeo working really fine. But only this URL is not working. But if I add via iframeit is working. But I need to add this via ...
user2584538's user avatar
0 votes
0 answers
379 views

Keep excerpt from stripping URLs and enable autoembed for youtube ONLY?

Is there an easy way to drop something into functions? I tried removing all filters from the_excerpt and the URLs are still being stripped (not links, but just straight URLs). I've scoured the ...
SHA3.org's user avatar
  • 119
2 votes
1 answer
2k views

Remove frameborder attribute from iframes

The W3C Validator outputs an error because Wordpress adds frameborder="0" to iframes. Also the Validator does not like the allow attribute. I found a similar question for Vimeo Videos: WordPress ...
Benjamin Schlegel's user avatar
1 vote
2 answers
917 views

How to check If Oembed is empty or not

We often use the Oembed function provided by the Wordpress to embed media. I have a condition where I am running a loop to fetch certain posts from a custom post type, but I want to skip posts in ...
WordCent's user avatar
  • 1,867
0 votes
1 answer
269 views

Printing OEmbed URL based on Post selected w/o page refresh

The hardcoded HTML looks like this → <iframe width="560" height="315" src="https://www.youtube.com/embed/G4Q0oX8wquU" allow="autoplay; encrypted-media" allowfullscreen></iframe> ...
WordCent's user avatar
  • 1,867
0 votes
1 answer
25 views

Replace Vimeo and Youtube in from scratch theme with from-the-group-up single post template?

I've inherited a theme that uses a totally in-house post display, and doesn't use the post loop. My question is, what function do I have to feed my post content object through in order to use oEmbed ...
Frank Bailey's user avatar
0 votes
0 answers
227 views

oembed facebook link?

I'm trying to oembed some facebook video . . . without ay chance so far . .. I'd like to avoid any plugin for this. I went through toe documentation but nothing to do, I'm declaring in my functions....
thibaultlgd's user avatar
0 votes
0 answers
807 views

Why doesn't wp_oembed_get() for the video post format not work?

I have this code: <?php if ( has_post_format ('video') ) { ?> <div class="video-head"> <?php $video = get_post_meta( $post->ID, '_format_video_embed', true ); ...
Jonathan Guerin's user avatar
2 votes
0 answers
821 views

How to Hide Ancestors/Threads in Embedded Tweets

I'd like my embedded tweets to not show a parent/ancestor, for example this is how Wordpress oEmbed displays a single tweet I'd prefer all to look like: I tried this approach to filter on ...
cogdog's user avatar
  • 141
1 vote
1 answer
46 views

Add field to dashboard to update embedded URL on homepage?

I've tried searching but all the "add a dashboard widget" answers seem overcomplicated trying to do far too much -- or else they are too simple (e.g. the widget simply displays a message; does not ...
code-sushi's user avatar
0 votes
1 answer
189 views

Remove link function from oembed image or video

I would like to include oembed video on my site, but I would like to disable the link back to the original site. Is this possible? Thank you!
Meg's user avatar
  • 1
0 votes
1 answer
377 views

How to set parameters for a Twitter post using wp_oembed_get (remove rounded borders)?

I'm very new to WordPress. I have managed to create a custom field for embedded content (using carbon fields) and oEmbed. It works by simply using the code: echo wp_oembed_get($variable); The $...
Jimm's user avatar
  • 1
0 votes
1 answer
538 views

Wordpress Mediaelement - Youtube Videos Embed Options

I have a custom field where I define the Youtube Url as a string. https://www.youtube.com/watch?v=3VqHtEF3LPE This then becomes the src in my theme's shortcode: <?php $ysrc = get_field('...
JoaMika's user avatar
  • 668
1 vote
1 answer
1k views

wp_embed_register_handler is not working

I used this function for other video hosts, but for some reason, now it's not working. This is the direct and embed code of the video https://vidoza.net/r2jeim68kuq6.html <IFRAME SRC="https://...
Archi25's user avatar
  • 33
1 vote
1 answer
1k views

Checkbox on a meta box using CMB2 Plugin

I have ADDED a meta box for Video using oembed by the help of CMB2 plugin. here is the code → $cmb->add_field( array( 'name' => ('oEmbed'), 'desc' => 'Enter a youtube, twitter, or ...
WordCent's user avatar
  • 1,867
1 vote
1 answer
579 views

Responsive embed for the video shortcode

I have impelmented a custom code to wrap a video embed in a .embed-responsive class to make it responsive with CSS then: PHP: function kadabra_responsive_embed( $html ) { return '<div class="...
Deka87's user avatar
  • 131
0 votes
1 answer
151 views

Use oEmbed for static html

I am trying to add a jQuery plugin (https://github.com/rmanivannan/speedometer-jquery-plugin) to a Wordpress page (not post), however the plugin is not behaving as expected. I think this may have ...
pcoz's user avatar
  • 101
1 vote
1 answer
498 views

How to disable YouTube (and any other oembed) embeding in the editor

It is easy to disable oEmbed on the front end Disable automatic oEmbed of a youtube url within the content, but this leaves us with the editor shows a video (in the case of youtube) where on the front ...
Mark Kaplun's user avatar
  • 23.4k
0 votes
1 answer
2k views

Removing WordPress Icon from oembed link footer

I am trying to remove the default WordPress icon that displays on oembed links when there is no site icon. Here is a link to the site(3 links at the bottom) https://libsource.com/library-as-a-service/...
Web Canvases's user avatar
1 vote
1 answer
432 views

Problem with oEmbed in some themes

I registered my oembed provider, in my wp cms (provider is not whitelisted in WP community). But I have problems with this oembed url. Mentioned oembed url is working in some themes, and in other I ...
Zagroda's user avatar
  • 11
3 votes
1 answer
5k views

Add wrapper to only youtube videos via embed_oembed_html filter function

I have a filter working to wrap embed_oembed links in a responsive wrapper. See code. add_filter('embed_oembed_html', 'wrap_embed_with_div', 10, 3); function wrap_embed_with_div($html, $url, $attr) ...
kidA's user avatar
  • 33
1 vote
1 answer
109 views

JSON in oembed not being internationalized (using QTranslateX)

I'm using the QTranslateX plugin at its latest version, 3.4.6.8, in a fresh WordPress 4.7.1 installation. At the moment everything is working OK. But I've seen that in JSON-oembed pages there's some ...
Iván Pérez's user avatar
1 vote
1 answer
2k views

class-oembed Error

PHP Fatal error: Cannot redeclare _wp_oembed_get_object() (previously declared in /home/samdonme/public_html/wp-includes/embed.php:112) in /home/samdonme/public_html/wp-includes/class-oembed.php on ...
S. Dönmez's user avatar
0 votes
1 answer
344 views

oEmbed fails half of the times. Could I reload the request on fail?

I'm developing a site where I'm using oEmbed through Advanced Custom Fields, to display vimeo-videos. This is major feature for the site, and one of the clients requests is that he/she needs to be ...
Hjalmar's user avatar
0 votes
0 answers
203 views

Adding an official oEmbed provider to Wordpress

How can I add an official oEmbed provider to this list: https://codex.wordpress.org/Embeds ?
Håvard Geithus's user avatar
4 votes
1 answer
920 views

how to escape wp_oembed_get for phpcs

I am using phpcs to help with making sure I write nice, valid WP theme code but am coming across the following issue regarding escaping before output. If I try to use echo wp_oembed_get( 'https://www....
Tims's user avatar
  • 151
9 votes
1 answer
18k views

What are the Oembed Links For?

My copy of WordPress outputs two <link/> tags in the header of (nearly?) every page. They look like this. <link rel="alternate" type="application/json+oembed" href="http://example.com/wp-...
Alana Storm's user avatar
0 votes
1 answer
1k views

oEmbed Video in Modal

I'm attempting to use jQuery to open up a video in a modal but can't come up with a way to pass the oEmbed video url to the function which opens the modal. In my theme the user adds the video to an ...
Kevin Nugent's user avatar
8 votes
1 answer
654 views

static variable loop not working in Wordpress

I have a function in my wordpress theme that deletes the first embedded video in a video post. See code below. This is in the functions.php file. /* - function that hides first video in post content -...
danny471's user avatar
  • 191
1 vote
2 answers
3k views

How to apply an ID to Shortcode Embedded iframe

I want to add an id="myid" to shortcode embedded iframe:- $video_url = get_post_meta($post_id, 'video_url',true); //or $video_url .= 'video url'; $check_embeds=$GLOBALS['wp_embed']->run_shortcode( ...
Krishna Karki's user avatar
2 votes
1 answer
1k 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 ...
Sledge Hammer's user avatar
1 vote
1 answer
394 views

WordPress, oEmbed & YouTube video's with a 'dash'

I am having an issue where a video with a 'dash' (-) in the url are not being embedded in WordPress. This is happening when pasting the URL into a page / post and is also able to be reproduced when ...
David Clough's user avatar
2 votes
1 answer
437 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-...
JediTricks007's user avatar
3 votes
1 answer
2k 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. ...
Tim Malone's user avatar
  • 4,734
1 vote
2 answers
814 views

Wrap iframes/embeds, but do it before oEmbed happens

I am trying to wrap any iframe/embed in my content with some Facebook Instant Articles friendly code (only for that feed). I have it working, but it adds this code to oEmbed output as well which adds ...
KKranzo's user avatar
  • 15
-1 votes
1 answer
903 views

oEmbed work on localhost but not on distant server

I've a trouble with oEmbed integration for YouTube on hosting server. I've a Wordpress site that is exactly the same on my localhost (MAMP 3.0.7.3 on MacOSX with PHP Version 5.6.2) and my distant ...
1kkmn2ts's user avatar
1 vote
1 answer
116 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 ...
someka's user avatar
  • 11
0 votes
1 answer
2k views

What are available arguments for wp_oembed_get?

I used wp_oembed_get function to embed a YouTube video. It worked like it should. Now I want to add a class to an embedded element. Is there an argument for this? Can't find list of arguments for ...
Boykodev's user avatar
  • 327
1 vote
0 answers
598 views

How can I remove the first video from a post and feature it?

I am trying to develop a theme in which when you select a 'video' post format, it automatically gets the first video from the post and features it (instead of where the featured image would normally ...
Dannyd86's user avatar
0 votes
2 answers
278 views

oEmbded with wp_insert_post() [embedly]

I try to add articles via wp_insert_post but as it seems the oEmbed function of Wordpress doesn't work properly. I work with embedly as you can embed any website. I realized that the oEmbed ...
delueg's user avatar
  • 107
5 votes
1 answer
885 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 ...
jgraup's user avatar
  • 9,744
3 votes
1 answer
931 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( $...
Florian's user avatar
  • 1,575