oembed_linktypes
Filters the link types that contain oEmbed provider URLs.
Usage
add_filter( 'oembed_linktypes', 'wp_kama_oembed_linktypes_filter' );
/**
* Function for `oembed_linktypes` filter-hook.
*
* @param string[] $format Array of oEmbed link types. Accepts 'application/json+oembed', 'text/xml+oembed', and 'application/xml+oembed' (incorrect, used by at least Vimeo).
*
* @return string[]
*/
function wp_kama_oembed_linktypes_filter( $format ){
// filter...
return $format;
}
- $format(string[])
- Array of oEmbed link types. Accepts 'application/json+oembed', 'text/xml+oembed', and 'application/xml+oembed' (incorrect, used by at least Vimeo).
Changelog
| Since 2.9.0 | Introduced. |
Where the hook is called
oembed_linktypes
wp-includes/class-wp-oembed.php 473-480
$linktypes = apply_filters( 'oembed_linktypes', array( 'application/json+oembed' => 'json', 'text/xml+oembed' => 'xml', 'application/xml+oembed' => 'xml', ) );