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:
parent
2417e42fe5
commit
c390c3afb0
|
@ -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