I’m not sure why that’s not working except maybe you need to put the returned stuff in a variable? This is what works for me when I put it in my functions.php file:
add_filter( 'embed_oembed_html', 'tdd_oembed_filter', 10, 4 ) ;
function tdd_oembed_filter($html, $url, $attr, $post_ID) {
$return = '<figure class="video-container">'.$html.'</figure>';
return $return;
}
Related Posts:
- Manipulating oembed_dataparse stopped working for YouTube embeds
- Embeding YouTube video via a template function throws iframe cross-domain policy error
- Video Embed with Captions in Turkish
- How to embed YouTube videos in posts without adding suggested videos at the end?
- WordPress Mediaelement – Youtube Videos Embed Options
- How do I embed youtube videos with https instead of http in the URL?
- WP Oembed not passing through the “autoplay=1” variable
- Modify youtube video size on one page and show another size on different page
- Set wmode attribute to transparent for the embed shortcode to make drop-down menu hover over YouTube embed in Internet Explorer
- How to change thumbnail of embedded Youtube video?
- How to add new embed handler not supported by oembed
- Youtube – Embed as IFRAME
- wp_embed_register_handler is not working
- Any way to use a custom Parameter for vimeo embed without using an iframe?
- Is it possible to modify the default YouTube embed attributes string?
- Removing WordPress Icon from oembed link footer
- Get all Youtube video’s from posts and embed them on a different page
- Hiding Comments Icon On oembed
- Youtube parameters within WordPress embed code?
- vimeo/youtube video embed with thumbnails
- Embed YouTube video from custom field value
- Can I use wp_oembed_get to detect a valid embeddable link or is there a better way to do so?
- extra text in Vimeo Embedded videos
- How can I force oEmbed to display fixed height & width dimensions?
- YouTube embed parameters?
- Embed Youtube video link in wordpress editor
- How to auto embedded youtube with wp_insert_post()
- How to apply an ID to Shortcode Embedded iframe
- How to change the way wp_embed handles only youtube videos?
- How to make my new theme read [youtube id=”id of the video here” width=”600″ height=”350″]?
- Embedding Youtube video on comments
- How to make enqueue_embed_scripts work with the embed_template filter
- YouTube embeded video will not resize (only full screen responsive) [closed]
- WordPress fails to embed video URL
- Add class and change src type inside wp_oembed_get
- How to disable URL preview in WordPress comments
- How to modify the HTML output of Gutenberg block? (Youtube)
- Remove wordpress embed share icon?
- Youtube iframe embed keeps disappearing from page
- Adding an official oEmbed provider to WordPress
- Completely disable oEmbed and auto-embed on frontend and post editor?
- How do I hide related videos at the end of a YouTube playlist embed code?
- Setting a post’s featured image from an embedded YouTube video
- Use [embed] filter in template files
- Do_Shortcode not working for Embed
- Get first video from the post (both embed and video shortcodes)
- How to Replace YouTube Videos with a “Click to Play” Thumbnail?
- YouTube oEmbed and privacy-enhanced mode
- add_filter to youtube embeds?
- Embed .mov file via ‘Add Media’ not working
- Any way to use a custom Parameter for youtube embed without using an iframe?
- How to remove the embed_footer?
- oEmbed youtube video aspect ratio
- use of tag into wordpress
- ted talks embed fixed, but can’t control size
- Add a YouTube or Vimeo video as a post attachment?
- How to create a static player top or bottom of wordpress?
- Embed YouTube video on category description
- Audio Playlists – Multiple file type support?
- Vimeo video embeds doesnt seem to work with ACF [closed]
- WordPress keeps altering my embed code
- WordPress, oEmbed & YouTube video’s with a ‘dash’
- disable video URL auto-embedding for a part of the post
- Instagram URL is converted into oEmbed
- Check if page is embeded
- How to set YouTube video as featured image?
- WordPress get embedded/attachment video
- pdf (25MB) – how to display and enable download?
- How can I grab the video id of youtube?
- Is there a way to create embed codes from wordpress/buddypress content?
- Embedded tweets get wrapped in tags and fail to load
- How To Display Content from a website on wordpress page?
- Reusing header.php from Yii application
- How do I not embed the SoundCloud player? I just want the link
- Add Watermark to PDF’s of logged in user in WordPress upon upload to media library [closed]
- Why is my get_post_meta not properly calling the custom field when attempting to embed a YouTube video?
- TED talk embedded videos cut off by sidebar
- Add parameter to first post only
- Help with jot form pro embed code
- Embed wikipedia page in WordPress?
- WordPress fails to embed video URL on specific theme
- Embed post wont work on custom post type
- How to add srcdoc attribute to YouTube oEmbed in Gutenberg oEmbed Block
- How to embed my latest WordPress post into an external page
- Facebook embeds fixing with functions.php
- Embed video from streamtape using direct link
- Embedded videos not displaying on page
- Security when outputing wp_oembed_get code
- Embed Microsoft Forms into WordPress page
- Why most embed feature doesn’t work?
- oembed facebook link?
- My WordPress editor deletes all characters after emoji – how can I fix this?
- Do_Shortcode not working for Embed any tweet
- How to make Youtube short code transfer
- Increase size of Google Document Site Wide [closed]
- Displaying cf post formats with oembed
- How to have embedded images from smugmug take full width of blog posts
- WordPress: embedding last posted video
- Enclosures being deleted “automatically”
- How to anchor to embed video