Skip to content

Instantly share code, notes, and snippets.

@borantula
Created June 17, 2014 09:22
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save borantula/d11e0af2f4a8fc2876b1 to your computer and use it in GitHub Desktop.
Save borantula/d11e0af2f4a8fc2876b1 to your computer and use it in GitHub Desktop.
WordPress Oembed Html from Url
<?php
function getOembedHtml($url,$width,$height)
{
require_once( ABSPATH . WPINC . '/class-oembed.php' );
$oembed = _wp_oembed_get_object();
$html = $oembed->get_html($url,array('width' => (int)$width,'height' => (int)$height) );
return $html;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment