Introduce wp_oembed_remove_provider(). Props r-a-y. fixes #16327
git-svn-id: https://develop.svn.wordpress.org/trunk@21351 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
5d062682ab
commit
46dd14c4e1
@ -1419,6 +1419,29 @@ function wp_oembed_add_provider( $format, $provider, $regex = false ) {
|
|||||||
$oembed->providers[$format] = array( $provider, $regex );
|
$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.
|
* Determines if default embed handlers should be loaded.
|
||||||
*
|
*
|
||||||
|
Loading…
Reference in New Issue
Block a user