Created
February 24, 2012 23:36
-
-
Save vc27/1904612 to your computer and use it in GitHub Desktop.
Use built in WP_oEmbed for fetching data
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once( ABSPATH . WPINC . '/class-oembed.php' ); | |
$WP_oEmbed = new WP_oEmbed(); | |
$provider = $WP_oEmbed->discover( $url ); | |
$data = $WP_oEmbed->fetch( $provider, $url ); | |
if ( isset( $data ) AND $data != false ) { print_r($data); } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I cant figure out why some providers don't work when using this method. I tried hulu and qik they both return nothing.