Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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