WordPress at a glance
function is not described

WP_oEmbed::get_data() public WP 4.8.0

Takes a URL and attempts to return the oEmbed data.

{} It's a method of the class: WP_oEmbed{}

No Hooks.


Object|false. The result in the form of an object on success, false on failure.


$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.
Additional arguments for retrieving embed HTML. See wp_oembed_get() for accepted arguments.
Default: ''


  • See: WP_oEmbed::fetch()


Since 4.8.0 Introduced.

Code of WP_oEmbed::get_data() WP 5.7.2

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;