描述:
移除一个oembed支持
用法:
<?php wp_oembed_remove_provider( $format ) ?>
参数:
$format
(string) (必填) 要删除的oEmbed的URL格式。
默认值: None
示例:
<?php wp_oembed_remove_provider( 'http://wordpress.tv/*' ); ?>
源文件:
/**
* Removes an oEmbed provider.
*
* @since 3.5.0
*
* @see WP_oEmbed
*
* @param string $format The URL format for the oEmbed provider to remove.
* @return bool Was the provider removed successfully?
*/
function wp_oembed_remove_provider( $format ) {
require_once( ABSPATH . WPINC . '/class-oembed.php' );
if ( did_action( 'plugins_loaded' ) ) {
$oembed = _wp_oembed_get_object();
if ( isset( $oembed->providers[ $format ] ) ) {
unset( $oembed->providers[ $format ] );
return true;
}
} else {
WP_oEmbed::_remove_provider_early( $format );
}
return false;
}