Skip to content

Instantly share code, notes, and snippets.

@nciske
Created September 3, 2012 21:42
Show Gist options
  • Save nciske/3613796 to your computer and use it in GitHub Desktop.
Save nciske/3613796 to your computer and use it in GitHub Desktop.
WordPress Run oEmbed Shortcode
// http://wordpress.org/support/topic/call-function-called-by-embed-shortcode-direct
// Doesn't work:
// $post_embed = do_shortcode('[embed]your-video-url[/embed]');
// Does work:
global $wp_embed;
$post_embed = $wp_embed->run_shortcode('[embed]your-video-url[/embed]');
@mintbird
Copy link

mintbird commented Feb 4, 2023

Thanks. This solution is working on WP 6.0.

Long live the bug!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment