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.

Return

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(array/string)
Arguments, usually passed from a shortcode.
Default: ''

Notes

  • See: WP_oEmbed::fetch()

Changelog

Since 4.8.0 Introduced.

Code of WP_oEmbed::get_data() WP 5.5.1

<?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;
}