Introduce wp_oembed_remove_provider(). Props r-a-y. fixes #16327

git-svn-id: http://core.svn.wordpress.org/trunk@21351 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2012-07-26 20:18:27 +00:00
parent 2417e42fe5
commit c390c3afb0
1 changed files with 23 additions and 0 deletions

View File

@ -1419,6 +1419,29 @@ function wp_oembed_add_provider( $format, $provider, $regex = false ) {
$oembed->providers[$format] = array( $provider, $regex );
}
/**
* Removes an oEmbed provider.
*
* @since 3.5
* @see WP_oEmbed
*
* @uses _wp_oembed_get_object()
*
* @param string $format The URL format for the oEmbed provider to remove.
*/
function wp_oembed_remove_provider( $format ) {
require_once( ABSPATH . WPINC . '/class-oembed.php' );
$oembed = _wp_oembed_get_object();
if ( isset( $oembed->providers[ $format ] ) ) {
unset( $oembed->providers[ $format ] );
return true;
}
return false;
}
/**
* Determines if default embed handlers should be loaded.
*