WP_oEmbed::get_data
Takes a URL and attempts to return the oEmbed data.
Method of the class: WP_oEmbed{}
No Hooks.
Returns
Object|false. The result in the form of an object on success, false on failure.
Usage
$WP_oEmbed = new WP_oEmbed(); $WP_oEmbed->get_data( $url, $args );
- $url(string) (required)
- The URL to the content that should be attempted to be embedded.
- $args(string|array)
- Additional arguments for retrieving embed HTML. See wp_oembed_get() for accepted arguments.
Default:''
Notes
- See: WP_oEmbed::fetch()
Changelog
| Since 4.8.0 | Introduced. |
WP_oEmbed::get_data() WP oEmbed::get data code WP 7.0
public function get_data( $url, $args = '' ) {
$args = wp_parse_args( $args );
$provider = $this->get_provider( $url, $args );
if ( ! $provider ) {
return false;
}
return $this->fetch( $provider, $url, $args );
}