Attempts to fetch the embed HTML for a provided URL using oEmbed.
Description
See also
Parameters
$url
stringrequired- The URL that should be embedded.
$args
array|stringoptional- Additional arguments for retrieving embed HTML.
width
int|stringOptional. Themaxwidth
value passed to the provider URL.height
int|stringOptional. Themaxheight
value passed to the provider URL.discover
boolOptional. Determines whether to attempt to discover link tags at the given URL for an oEmbed provider when the provider URL is not found in the built-in providers list. Default true.
Default:
''
Source
function wp_oembed_get( $url, $args = '' ) {
$oembed = _wp_oembed_get_object();
return $oembed->get_html( $url, $args );
}
Changelog
Version | Description |
---|---|
2.9.0 | Introduced. |
Retrieve the embed code for a URL from a supported
oEmbed
provider – withwidth
argument:Retrieve the embed code for a URL from a supported
oEmbed
provider: