wpseek.com
Uma área de pesquisa sobre o WordPress para devs e autores do tema



wp_filter_pre_oembed_result › WordPress Function

Desde4.5.3
Obsoleton/a
wp_filter_pre_oembed_result ( $result, $url, $args )
Parâmetros: (3)
  • (null|string) $result The UNSANITIZED (and potentially unsafe) HTML that should be used to embed. Default null.
    Required: Yes
  • (string) $url The URL that should be inspected for discovery `<link>` tags.
    Required: Yes
  • (array) $args oEmbed remote get arguments.
    Required: Yes
Retorna:
  • (null|string) The UNSANITIZED (and potentially unsafe) HTML that should be used to embed. Null if the URL does not belong to the current site.
Definido em:
Codex:

Filters the oEmbed result before any HTTP requests are made.

If the URL belongs to the current site, the result is fetched directly instead of going through the oEmbed discovery process.


Fonte

function wp_filter_pre_oembed_result( $result, $url, $args ) {
	$data = get_oembed_response_data_for_url( $url, $args );

	if ( $data ) {
		return _wp_oembed_get_object()->data2html( $data, $url );
	}

	return $result;
}