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
0answers
18 views

How can I grab the video id of youtube?

I tried $videoID = wp_oembed_get( get_post_meta( get_the_ID(), 'video_url', true ) ); but that doesn't seem to do anything. I'm trying to set playlist id as the video id so the video loops itself. ...
0
votes
0answers
31 views

Cannot display the_content() after removed WordPress 5's auto embed feature (iframe & blockquote)

Novice here, please help. I made a dynamic page with Custom Post Type UI plugin where the user can input news updates. The information to be filled are date, title, and a link (a clickable button that ...
0
votes
0answers
23 views

Oembed support for private Google Drive previews

I have a wordpress intranet for my company where I want to insert previews (i.e. iframes) of some of the company's private PDF files that are stored in Google Drive. So I don't want those files to be ...
0
votes
0answers
5 views

How do I pull out an embed out of a post's content?

I wanna pull out an embed (its output) from a post. Here's what I've tried so far: Go through the post. Find any links by any regex. Look in an array to see if that link's baseline youtube is ...
0
votes
1answer
18 views

Security when outputing wp_oembed_get code

This is a code I have in a function.php action. It is responsible for getting and displaying an embed code. Typically there is a youtube link from $embed_link but it comes from a public form so it can ...
2
votes
2answers
82 views

Register Embed Handler for Padlet.com

I'm trying and failing to register an embed code for content from padlet.com (strangely it's supported in WP.com but not WP.org). A URL like https://padlet.com/cogdogblog/aos9fosbbwk4 should embed ...
0
votes
1answer
38 views

How to disable URL preview in Wordpress comments

I disabled URL embed in Wordpress using the following code in functions.php: function my_deregister_scripts(){ wp_dequeue_script( 'wp-embed' ); } add_action( 'wp_footer', 'my_deregister_scripts' ); ...
1
vote
1answer
48 views

How do I phpunit test a post output process?

I like to know how to test the html output of a post. Like WP would output it on the frontend in reality. My specific case at this point is to test oembed caching as I want to test re-caching. AFAIK ...
2
votes
1answer
73 views

How to remove the embed_footer?

I'm trying to remove the entire embed_footer from WordPress embedded posts. By adding the following code in the functions.php, I was able to remove the site title and comments icon. But still, the ...
1
vote
1answer
147 views

Applying an oEmbed filter to a custom post type

I have a function in my functions.php file which takes any embedded YouTube URL, appends &rel=0 to the end of the URL, and wraps it in a <div>. It works perfectly for YouTube URLs I paste ...
0
votes
0answers
730 views

How to modify the HTML output of Gutenberg block? (Youtube)

I'm using a headless Wordpress linked to a Nuxt projet and I like to modify the output of my Gutenblock when it's called from the REST API. Current ouput is : <!-- wp:core-embed/youtube {"url":"...
0
votes
1answer
40 views

Combine embed_oembed_html and oembed_result

I have two functions that are exactly the same, because they are applied to different filters...is there any way to combine them so I don't have to write them out twice? My code: function ...
0
votes
0answers
98 views

How to disable oembed cache service?

Today I delete all oembed records by postmeta where meta_key like '_oembed%' after 5 mins, check again the table, magic, the wordpress started to insert _oembed records again (9857 total)... Can ...
1
vote
0answers
34 views

How to set up front end editor to autoembed media for non-logged in users?

I have a series of themes that allow site visitors to contribute content as posts (they enter as drafts) from a front end editor. I have been using a technique of invisibly logging them in as an ...
0
votes
0answers
15 views

Is there a way to late trigger oembeds?

Sometimes, with the theme I am working on creating, the posts that are only oembed do not display and I have to refresh the page to see them. I assume that there is a function that triggers to make ...
0
votes
0answers
13 views

The output of wp_oembed_get appears to ignore local blog URLs

The output of wp_oembed_get appears to ignore local blog URLs - why is this? If I set some var, say, $mylink which contains the URL to a post on my blog. Then I call wp_oembed_get($mylink) it ...
0
votes
0answers
63 views

How do I keep my iframes responsive and scaled to fit their container?

This is a WordPress core question and only a CSS question as a byproduct. I am designing a theme using bootstrap. Everything looks exactly as I want it to with one exception - links embedded from my ...
0
votes
0answers
23 views

Is the return value of wp_oembed_get() a valid block?

In the answer to "How does WP detect format type (and can I make use of this)?" a method is given for detecting block type. If I passed in the result of, say, $out = wp_oembed_get($href); would that ...
0
votes
0answers
36 views

What is the correct way to obtain access to the WP_oEmbed object?

I know that WP_oEmbed is a class used by WordPress to handle oEmbeds. Is this available as a global or should I create a new instance of it? Update: I have found a function called ...
0
votes
1answer
69 views

Can I use wp_oembed_get to detect a valid embeddable link or is there a better way to do so?

I am looking for an efficient way to detect if user input is a valid embed link (and of what type). I know that one can cause WordPress to run its embed code with arbitrary input. For example, like ...
1
vote
0answers
56 views

How to register a embed handler as a fallback to a oEmbed handler?

Testing this with the Embed Gutenberg Block. In the backend it actually shows the video so this seems wrong that it behaves differently there. Registering embed handlers causes the to take priority ...
0
votes
0answers
61 views

Use get_media_embedded_in_content to get Youtube links not in their own line

I am currently using the blow code: $media = get_media_embedded_in_content( apply_filters( 'the_content', get_the_content() ) ); echo $media[0]; This is getting any YouTube link someone posts ...
1
vote
1answer
951 views

oEmbed 404 errors when trying to use embed block

When trying to add a Youtube Embed Block in the Gutenberg editor, I'm seeing these 404 errors in the browser console: GET https://example.com/wp-json/oembed/1.0/proxy?url=https%3A%2F%2Fwww.youtube....
0
votes
0answers
534 views

Advanced Custom Fields oEmbed video width and height

I'm using Advanced Custom Fields plugin and i have a oEmbed field in it where i want to display YouTube videos. This is how they look now: http://electives-abroad.org/custom-field-test/ Why do they ...
0
votes
0answers
110 views

oembed_dataparse filter not running at all for standard YouTube embed

I need to wrap a div around all YouTube embeds in posts on our WP site. WordPress version is 4.9.6 The posts in question are WooComerce products Videos are being embedded by simply pasting a YouTube ...
1
vote
1answer
247 views

What is the correct oembed provider base url for self-hosted wordpress sites

I used to have both PCsteps.gr and Lifesteps.gr on the same server with the same IP. Oembed would work by default, I could embed posts from one site to the other without any problems. However, since ...
0
votes
1answer
192 views

Remove wordpress embed share icon?

I am modifying my embed-content.php. I find the functions here to remove some oembed icons but not the share icon. I do not find a function to remove JUST the share icon on wordpress oembeds. Can ...
0
votes
2answers
4k views

Advanced Custom Fields oembed only outputs YouTube URL

Having the exact same problem as @Hjalmar on Advanced Custom Fields, but still no fix. Only the URL text displays. Tried the original ACF oembed option: <div class="embed-container"> <?...
1
vote
1answer
82 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-...
0
votes
0answers
59 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 ...
2
votes
1answer
583 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="...
0
votes
1answer
146 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 ...
1
vote
2answers
690 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-...
2
votes
1answer
210 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 ...
0
votes
1answer
94 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 ...
1
vote
0answers
14 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?
1
vote
0answers
732 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 ...
0
votes
0answers
183 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 ...
2
votes
1answer
1k 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 ...
1
vote
2answers
293 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 ...
0
votes
1answer
114 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> ...
0
votes
1answer
21 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 ...
0
votes
0answers
182 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....
0
votes
0answers
411 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 ); ...
0
votes
0answers
404 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 ...
1
vote
1answer
33 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 ...
0
votes
1answer
36 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!
0
votes
1answer
236 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 $...
0
votes
1answer
427 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('...
1
vote
1answer
708 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://...