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
- Show shortcode without executing it
- How to create a shortcode with 1 parameter (atts)
- How does a shortcode work?
- Run visual composer code in php page
- Remove wptexturize from a shortcode?
- Using shortcode in Post title
- How to embed page content in a blog post
- Audio or playlist shortcode condition according to the amount of files on attachment page
- WP_enqueue_script inside shortcode?
- template_redirect to accompany with a shortcode
- Tinymce shortcodes within shortcode contents
- passing multiple parents value into a shortcode
- How do I preview the result of a shortcode in the TinyMCE editor?
- Conditionally loading Facebook PHP SDK in shortcode
- Can I use wp_oembed_get to detect a valid embeddable link or is there a better way to do so?
- Why are Shortcodes Disabled in Widgets by Default?
- Add attribute to shortcode dynamically
- Add custom setting that uses radio button to WP Gallery
- Shortcode with hyphen doesn’t work
- WordPress Gallery shortcode: Display one category ID only
- How to get gallery id inserted to a post?
- WordPress Shortcode show database row
- Shortcode “post_per_page” not working
- Shortcodes won’t work on live environment
- Create a short code to display a specific loop
- Hide Selection of Text From Archive, but Show on Single Posts
- Auto embeding Vimeo/Youtube in custom fields (tinyMCE editor)
- Function result goes outside div
- Displaying shortcode in footer
- Displaying shortcode output through Options Framework
- How to Generate html tags using shortcodes?
- Embedding Youtube video on comments
- Adding custom form within add_shortcode
- Use another action instead of the shortcode API to display the last time a user logged in
- how to add shortcode in wordpress container [duplicate]
- Get array of shortcodes within string
- Adding a custom field to do_shortcode [closed]
- Clearfix Shortcode
- How and when to include shortcode source files
- Use full size images in a specific gallery
- contact form 7 database short codes [closed]
- how to create a fav icon shortcode?
- How to deal with WordPress bug: can’t use wrapped and unwrapped shortcode on same post
- Video shortcode, option are not rendered
- Create shortcode for each form field in contact form 7
- Displaying an interactive web map on my wordpress site
- Date Shortcode in Image alt and title tags
- access shortcode atts in template part
- How to disable URL preview in WordPress comments
- May an attribute have no value?
- How to set up posts per page on WP
- SQL query to bulk change short code in all posts
- Display shortcode in text field with wordpress settings api
- How to display a page dependent on a url parameter supplied by a form/button page?
- WordPress plugin shortcodes not outputting anything
- WordPress Gallery with ID’s Shortcode not Working
- Featured image with link to post shortcode, image displaying above the post
- Escaping a shortcode so it displays as-is [duplicate]
- If do_shortcode is blank, return some message
- Previous/Next with the same category
- I’ve broken the short code for Contact Form 7!
- echo a shortcode in a shortcode code?
- Applying if (get_post_meta) to new shortcode
- Shortcode attributes from meta query variables