WP_oEmbed::get_data │ public │ WP 4.8.0

Takes a URL and attempts to return the oEmbed data.

Метод класса: WP_oEmbed{}

Хуков нет.

Возвращает

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(строка) (обязательный)
The URL to the content that should be attempted to be embedded.
$args(строка|массив)
Additional arguments for retrieving embed HTML. See wp_oembed_get() for accepted arguments.
По умолчанию: ''

Заметки

Смотрите: WP_oEmbed::fetch()

Список изменений

С версии 4.8.0 Введена.

Код WP_oEmbed::get_data() WP 7.1.3

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