WP_oEmbed::get_data( string $url, array|string $args = '' )
Takes a URL and attempts to return the oEmbed data.
Description
See also
Parameters
- $url
-
(Required) The URL to the content that should be attempted to be embedded.
- $args
-
(Optional) Arguments, usually passed from a shortcode.
Default value: ''
Return
(false|object) False on failure, otherwise the result in the form of an object.
Source
File: wp-includes/class-oembed.php
public function get_data( $url, $args = '' ) {
$args = wp_parse_args( $args );
$provider = $this->get_provider( $url, $args );
if ( ! $provider ) {
return false;
}
$data = $this->fetch( $provider, $url, $args );
if ( false === $data ) {
return false;
}
return $data;
}
Changelog
Version | Description |
---|---|
WP-4.8.0 | Introduced. |