Hot answers tagged

35 votes

What does wp-embed.min.js do in WordPress 4.4?

I arrived at this thread with the same question: What does the wp-embed.min.js file do? None of the current answers accurately address this question. Firstly, I am fairly certain that embed.min.js ...
Jonathan Nicol's user avatar
9 votes

What does wp-embed.min.js do in WordPress 4.4?

Trix's answer didn't work out for me on WordPress 4.4.1, but I found a solution in the code of Disable Embeds WordPress plugin. Add this code (modified) in your theme's functions.php file to remove ...
Nadeem Khan's user avatar
6 votes

Wordpress Gutenberg Embed Blocks Are Not Responsive

It may be that your theme hasn't declared support for responsive embeds. Try adding this code to your functions.php // Add support for responsive embedded content. add_theme_support( 'responsive-...
rudtek's user avatar
  • 6,091
5 votes
Accepted

How to change WordPress embedded player size or show just the play button

I assume you're talking about embedding audio files, like: [embed]http://s.w.org/images/core/3.9/AintMisbehavin.mp3[/embed] The audio embed handler is registered within wp_maybe_load_embeds() and ...
birgire's user avatar
  • 66.9k
4 votes
Accepted

Hiding Comments Icon On oembed

Pretty sure you can just remove them entirely: remove_action( 'embed_content_meta', 'print_embed_comments_button' );
TheDeadMedic's user avatar
  • 36.3k
4 votes

What does wp-embed.min.js do in WordPress 4.4?

I think this part is still missing. What does the wp-embed.min.js file do? I noticed it is added to the end of my blog page footer. The answer to this question is in the track. https://core.trac....
prosti's user avatar
  • 4,283
4 votes
Accepted

Video embeds work in backend, but are not parsed in frontend

I've just looked at the source of the WP_Embed class, and it appears they are not actually registering a shortcode, but hooking into the the_content filter. Change your code to $content_desktop = ...
janh's user avatar
  • 2,728
4 votes

How to embed a WordPress article on another website

do you try the Wordpress REST Api? It is an easy way to add content from your Wordpress Site to an other website. EDIT: After the comment form Mark Kaplun, i edited my answer and add a small ...
user141080's user avatar
3 votes

WP Oembed not passing through the "autoplay=1" variable

Cross-posting my answer from https://stackoverflow.com/a/55053642/799327, hope that's okay since it's from the same OP: So, after some research on this, the best way to do this is to leverage the ...
Laust Deleuran's user avatar
3 votes
Accepted

removing <p> tags around img, iframes and also scripts

This should do it and also remove <p> tags from images that are linked. Why it removes it from only one <script> instance is hard to tell. Would have to see your website code to ...
cowgill's user avatar
  • 1,072
3 votes

disable video URL auto-embedding for a part of the post

Well... To embed a video or another object into a post or page, place its URL into the content area. Make sure the URL is on its own line and not hyperlinked (clickable when viewing ...
s_ha_dum's user avatar
  • 65.1k
3 votes
Accepted

Applying custom filter instead of the_content doesn't render embeds

the_content filter is as good as other filters are. The issue is that it is supposed to be run inside a loop with the glogal $post correctly set to current post in the loop. So, you could do something ...
cybmeta's user avatar
  • 20.4k
3 votes
Accepted

How to change thumbnail of embedded Youtube video?

The [video] shortcode can be used with the src being an URL of a youtube video. To set a placeholder, preview thumbnail use poster, it even works nicely via GUI. In the end it should look somewhat ...
Nicolai Grossherr's user avatar
3 votes
Accepted

WP Query by Gutenberg block and get its attribute

After hours of googling I came up with following solution. Maybe once will help to someone. 1) query post where is used gutenberg youtube block: $args = array( 'post_type' => 'post', ...
Tomáš Vavřinka's user avatar
3 votes

Wordpress Gutenberg Embed Blocks Are Not Responsive

If you don't already have it, add body_class(); to the themes body tag <body <?php body_class(); ?>>
Reberg's user avatar
  • 31
3 votes
Accepted

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

The regex patterns for matching embeddable URLs are stored in WP_oEmbed, which has the method get_provider() for checking if a given URL is an embeddable URL for a supported provider. Just set the ...
Jacob Peattie's user avatar
3 votes
Accepted

Wordpress block editor embeds not working in theme (single.php)

That would be because they're using oEmbed, not a shortcode. You should use the function the_content() to render the content of a post, as it applies all the things required to make embeds, shortcodes,...
cameronjonesweb's user avatar
3 votes
Accepted

How to anchor to embed video

Editing the raw HTML isn't going to work, a worst case scenario is it fails block validation when reopened in the editor and your edits get replaced automatically. Instead, use the anchor box under ...
Tom J Nowell's user avatar
  • 58.9k
2 votes
Accepted

Manipulating oembed_dataparse stopped working for YouTube embeds

I think I solved by doing this: add_filter('oembed_dataparse', 'bolster_oembed_filter', 0, 2 ); I changed the priority of the add_filter statement to 0, now it works again.
Florian's user avatar
  • 1,575
2 votes

Youtube - Embed as IFRAME

If you don't want to utilize the latest oembed functions and want the old iframe way from any page or post, you can do these: Get the embed code from any youtube video. While editing/creating your ...
Carl Alberto's user avatar
  • 1,067
2 votes
Accepted

Customize Embedded Tweets (or, How To Hide Photos in Embedded Tweets)

Here's one way using the oembed_fetch_url filter to add the hide_media query parameter, that's also mentioned in the Twitter doc page you linked to: Set an oEmbed query parameter of hide_media=true ...
birgire's user avatar
  • 66.9k
2 votes
Accepted

How can I override print_embed_sharing_dialog() in Wordpress 4.5

You can't modify the core function's output, but you can replace it with your own function by unhooking it from embed_footer and adding your own function with custom output: remove_action( '...
Caspar's user avatar
  • 950
2 votes

Video Embed with Captions in Turkish

Okay the thing is that the oembed endpoint seems not to support any other than the default parameters. So it seems that all you can do is parse the response and add in your parameters to the iframe ...
kraftner's user avatar
  • 5,598
2 votes
Accepted

wp_embed_register_handler not working

I modified the example you posted from the Codex: /** * Embed support for Forbes videos * * Usage Example: * * http://www.forbes.com/video/5049647995001/ */ add_action( 'init', function() { ...
birgire's user avatar
  • 66.9k
2 votes

Front end wp_editor not rendering audio/video links

I've been fighting this for a while on a series of themes I make that provide a front end content creation interface not requiring a WP account. For the last two years I have said "trust me, URLs will ...
cogdog's user avatar
  • 141
2 votes
Accepted

custom field (video/audio url) and embed functionality

As you are using URLs from oEmbed provides (YouTube, Vimeo, Soundcloud, etc), I would use wp_oembed_get() function. This function uses oEmbed and tries to get the embed HTML of the provided URL. $...
cybmeta's user avatar
  • 20.4k
2 votes
Accepted

How to add new embed handler not supported by oembed?

Pretty sure it's the fact you're trying to use the regex pattern in your sprintf call, when you should be using... well, a sprintf format: $embed = sprintf( '<iframe class="openload-video" src=...
TheDeadMedic's user avatar
  • 36.3k
2 votes
Accepted

Check if page is embeded

The server doesn't know what the client is doing with the output and as such, you're limited in what you can assume. You may or may not have params sent in the request, referer, current uri and ...
jgraup's user avatar
  • 9,719
2 votes

YouTube embed parameters?

There's always a filter you can use to hook into the output, see embed_oembed_html. Try this in a custom plugin or child theme's functions file, it will add any other query strings to the iframe src ...
Ismail's user avatar
  • 1,936
2 votes
Accepted

wp_embed_register_handler is not working

You are trying to match the r2jeim68kuq6.html part, but you're not allowing dots in your regex pattern here: '#https://vidoza\.net/([a-zA-Z0-9_-]+)$#i' You can try e.g. (removing the A-Z too because ...
birgire's user avatar
  • 66.9k

Only top scored, non community-wiki answers of a minimum length are eligible