1.- Add this to your child theme’s functions file:
add_filter("embed_oembed_html", function( $html, $url, $attr ) {
if ( !empty( $attr['id'] ) ) {
$html = str_replace( "<iframe", sprintf( '<iframe id="%s"', $attr['id'] ), $html );
}
return $html;
}, 10, 3);
2.- Now use </code> applying the ID attribute in the shortcode.</p>
<pre><code>$check_embeds=$GLOBALS['wp_embed']->run_shortcode(
''. $video_url .''
);
Hope that helps.
Related Posts:
- Set wmode attribute to transparent for the embed shortcode to make drop-down menu hover over YouTube embed in Internet Explorer
- Get first video from the post (both embed and video shortcodes)
- Instagram URL is converted into oEmbed
- Responsive Embeds using default embed shortcode
- Auto embeds don’t work for attachment descriptions
- TED talks shortcode not working
- Modify youtube video size on one page and show another size on different page
- Video embeds work in backend, but are not parsed in frontend
- Manipulating oembed_dataparse stopped working for YouTube embeds
- Disable oEmbed for a Single Shortcode or at Least All Internal Links
- Get all Youtube video’s from posts and embed them on a different page
- Why isn’t this youtube shortcode working?
- Gist shortcode is not working
- Embedding Instagram via shortcode doesn’t work as advertised in official docs
- Embeding YouTube video via a template function throws iframe cross-domain policy error
- Video Embed with Captions in Turkish
- How to create a shortcode for embedding pdf in iframe?
- Responsive embed for the video shortcode
- Hook WP_Embed run_shortcode
- Detecting embeded video format
- Specifying a single file from multi-file GIST (wordpress.com) [closed]
- How to embed YouTube videos in posts without adding suggested videos at the end?
- Forcing WP to embedd a video when using a shortcode
- Div around YouTube video
- Custom youtube shortcode that uses $content
- Looking to Customize YouTube Video Embeds
- Adding YouTube button to TinyMCE editor
- Rename Smart YouTube’s httpv back to http for all posts
- Is there any way to set the Featured image in wordpress post editor, using a Getty images embed code
- How to modify the HTML output of Gutenberg block? (Youtube)
- How to Enable embedding WordPress default gallery in comments?
- WordPress Mediaelement – Youtube Videos Embed Options
- Do embed shortcode on wordpress ajax request
- Inserting a variable into a shortcode inside php
- How to stop unwanted splits in excerpts when using shortcodes for sliders or players
- Can’t get default values to work with custom shortcode
- add_filter is failing to append &rel=0 to end of YouTube URL in oEmbed
- How do I hide related videos at the end of a YouTube playlist embed code?
- convert it into short code & explan how? [closed]
- Enqueue Scripts / Styles when shortcode is present
- Conditionally Loading JavaScript/CSS for Shortcodes
- What does extract( shortcode_atts( array( do?
- How do I escape a ‘]’ in a short code?
- Pass boolean value in shortcode
- Show shortcode without executing it
- Shortcode always displaying at the top of the page
- Setting a post’s featured image from an embedded YouTube video
- Redirect function inside a Shortcode
- How to create a shortcode with 1 parameter (atts)
- how to show the syntax of a shortcode
- Custom shortcode being executed when saving page in wp-admin
- Change appearance of shortcode text inside editor
- current_shortcode() – detect currently used shortcode
- Use [embed] filter in template files
- Do_Shortcode not working for Embed
- shortcodes output before content [duplicate]
- WordPress plugin shortcode not working
- How to add stylesheets only to pages with specific shortcode?
- Using get_option() in JavaScript
- How do I embed youtube videos with https instead of http in the URL?
- WP Oembed not passing through the “autoplay=1” variable
- Shortcode empty attribute
- How does a shortcode work?
- Shortcode outputs at the top of the_content
- the_excerpt and shortcodes
- Using wp_editor in shortcode
- Remove wpautop from shortcode content / remove whitespace in buffering
- Get current post id witout passing in shortcode
- Why are you using add_action for shortcode?
- How to get URL param to shortcode?
- How to add multiple buttons to TinyMCE?
- Check if post/page has gallery?
- Get shortcode name from within it’s callback function? [duplicate]
- Wordspress add into my javascripts
- Making a Shortcode [NEXT] and [PREVIOUS] to place into specific posts for post navigation
- How do I create a Shortcode that returns text if domain is .com, not .co.uk
- Using preg_replace to separate gallery from the_content?
- Remove specific shortcode from get_the_content()
- How to display the site name in a WordPress page, or post
- Hide/show content starting in the middle of a paragraph
- Combining shortcode and get_template_part
- How can I put a wp_redirect into a shortcode?
- How can I clear oEmbed caches for YouTube on posts as they are loaded
- Escaping quotes from shortcode attributes
- Run visual composer code in php page
- short code output too early
- Shortcode in shortcode: How to append variable?
- Remove wptexturize from a shortcode?
- How can i put an array as variable in shortcode_atts?
- Autoembeds don’t work with paragraphs
- How add class youtube and type/html to oembed code?
- Table of Contents with a shortcode
- Create custom [sourcecode] shortcode, the right way?
- How to Replace YouTube Videos with a “Click to Play” Thumbnail?
- Allowing shortcodes inside attributes
- What is the best way to enable nested shortcodes?
- YouTube oEmbed and privacy-enhanced mode
- Tinymce – How to hook before or after live shortcodes rendering?
- How to customize a shortcode using the customizer
- Native “playlist” shortcode random playing… How?