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 discover
argument to false if you don’t want to actually send a request to the URL to test it, and just want to match the regex:
$url="https://twitter.com/WordPress/status/1169427892406644736";
$oembed = new WP_oEmbed();
$provider = $oembed->get_provider( $url, [ 'discover' => false ] );
if ( false !== $provider ) {
// Is embeddable.
}
Related Posts:
- WP Oembed not passing through the “autoplay=1” variable
- How to add new embed handler not supported by oembed
- Manipulating oembed_dataparse stopped working for YouTube embeds
- wp_embed_register_handler is not working
- Any way to use a custom Parameter for vimeo embed without using an iframe?
- Removing WordPress Icon from oembed link footer
- Hiding Comments Icon On oembed
- Embeding YouTube video via a template function throws iframe cross-domain policy error
- extra text in Vimeo Embedded videos
- Video Embed with Captions in Turkish
- How can I force oEmbed to display fixed height & width dimensions?
- How to embed YouTube videos in posts without adding suggested videos at the end?
- Div around YouTube video
- How to make enqueue_embed_scripts work with the embed_template filter
- Add class and change src type inside wp_oembed_get
- How to disable URL preview in WordPress comments
- Remove wordpress embed share icon?
- WordPress Mediaelement – Youtube Videos Embed Options
- Adding an official oEmbed provider to WordPress
- Completely disable oEmbed and auto-embed on frontend and post editor?
- How do I embed youtube videos with https instead of http in the URL?
- How can I change Max Embed Size in WordPress 3.5?
- Get first video from the post (both embed and video shortcodes)
- Soundcloud embed shortcode does not work
- Modify youtube video size on one page and show another size on different page
- wp_embed_register_handler not working
- Embed .mov file via ‘Add Media’ not working
- Detecting Embed URLs Within post_content
- Youtube – Embed as IFRAME
- Customize Embedded Tweets (or, How To Hide Photos in Embedded Tweets)
- How to remove the embed_footer?
- how to embed external webpage in my wordpress page
- use of tag into wordpress
- Is it possible to modify the default YouTube embed attributes string?
- ted talks embed fixed, but can’t control size
- Get all Youtube video’s from posts and embed them on a different page
- Youtube parameters within WordPress embed code?
- wp_embed_register_handler to embed html files
- How to create a static player top or bottom of wordpress?
- Audio Playlists – Multiple file type support?
- Vimeo video embeds doesnt seem to work with ACF [closed]
- Search XML file from within WordPress?
- WordPress keeps altering my embed code
- disable video URL auto-embedding for a part of the post
- Instagram URL is converted into oEmbed
- Check if page is embeded
- Responsive embed for the video shortcode
- YouTube embed parameters?
- Embed Youtube video link in wordpress editor
- WordPress get embedded/attachment video
- pdf (25MB) – how to display and enable download?
- Outside url for post content
- want to stop stripping out from my post content
- How to register a embed handler as a fallback to a oEmbed handler?
- Is there a way to create embed codes from wordpress/buddypress content?
- Display total questions of Moodle in WordPress [closed]
- How to display real-time data which is stored in an IBM Cloud web app
- MP4 video on wordpress working on desktop, not on mobile devices
- Embedding custom posts with REST API
- Embedded tweets get wrapped in tags and fail to load
- How to change the way wp_embed handles only youtube videos?
- Responsive Embeds using default embed shortcode
- How can I replace an oEmbed URL in post with actual embed HTML
- How To Display Content from a website on wordpress page?
- How to put an external object into WordPress to that occupies most of the available space?
- Reusing header.php from Yii application
- WordPress get_media_embedded
- Add custom parameters in SoundClound embed
- 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]
- TED talk embedded videos cut off by sidebar
- oEmbded with wp_insert_post() [embedly]
- Help with jot form pro embed code
- WordPress fails to embed video URL
- changes after I save a post
- Is there a way to do nested embeds in the REST API?
- Embed post wont work on custom post type
- How to embed my latest WordPress post into an external page
- Facebook embeds fixing with functions.php
- Embed video from streamtape using direct link
- [embed]Using WordPress 5.5.1 there is no embed option after the video is uploaded
- Embedded videos not displaying on page
- Why does my custom html code (for a donation form) appear in a preview but not in the published post?
- Security when outputing wp_oembed_get code
- Embed Microsoft Forms into WordPress page
- How to modify the HTML output of Gutenberg block? (Youtube)
- Why most embed feature doesn’t work?
- Youtube iframe embed keeps disappearing from page
- oembed facebook link?
- how to embed a .mp4 video the url postfix with secret key
- My WordPress editor deletes all characters after emoji – how can I fix this?
- Do_Shortcode not working for Embed any tweet
- 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 can I create iframe/embeddable content from my WordPress site?
- How to anchor to embed video
- Embed links work on new page creation, not on edit