oembed_dataparse filter-hookWP 2.9.0

Filters the returned oEmbed HTML.

Use this filter to add support for custom data types, or to filter the result.

Usage

add_filter( 'oembed_dataparse', 'wp_kama_oembed_dataparse_filter', 10, 3 );

/**
 * Function for `oembed_dataparse` filter-hook.
 * 
 * @param string $return The returned oEmbed HTML.
 * @param object $data   A data object result from an oEmbed provider.
 * @param string $url    The URL of the content to be embedded.
 *
 * @return string
 */
function wp_kama_oembed_dataparse_filter( $return, $data, $url ){

	// filter...
	return $return;
}
$return(string)
The returned oEmbed HTML.
$data(object)
A data object result from an oEmbed provider.
$url(string)
The URL of the content to be embedded.

Changelog

Since 2.9.0 Introduced.

Where the hook is called

WP_oEmbed::data2html()
oembed_dataparse
wp-includes/class-wp-oembed.php 726
return apply_filters( 'oembed_dataparse', $return, $data, $url );

Where the hook is used in WordPress

wp-includes/class-wp-oembed.php 218
add_filter( 'oembed_dataparse', array( $this, '_strip_newlines' ), 10, 3 );
wp-includes/default-filters.php 665
add_filter( 'oembed_dataparse', 'wp_filter_oembed_iframe_title_attribute', 5, 3 );
wp-includes/default-filters.php 666
add_filter( 'oembed_dataparse', 'wp_filter_oembed_result', 10, 3 );