| 1408 | } |
| 1409 | |
| 1410 | /** |
| 1411 | * Removes a URL format and oEmbed provider URL pair. |
| 1412 | * |
| 1413 | * @since 3.1 |
| 1414 | * @see WP_oEmbed |
| 1415 | * |
| 1416 | * @uses _wp_oembed_get_object() |
| 1417 | * |
| 1418 | * @param string $match The URL format for the oEmbed provider. Can input an exact match for the format or just a portion. eg. 'youtube'. |
| 1419 | * @param string $provider The URL to the oEmbed provider. Must be exact match. |
| 1420 | */ |
| 1421 | function wp_oembed_remove_provider( $match, $provider ) { |
| 1422 | require_once( ABSPATH . WPINC . '/class-oembed.php' ); |
| 1423 | $oembed = _wp_oembed_get_object(); |
| 1424 | |
| 1425 | foreach ( $oembed->providers as $format => $param ) { |
| 1426 | if ( strpos( $format, $match ) !== false && $param[0] == $provider ) { |
| 1427 | unset( $oembed->providers[$format] ); |
| 1428 | break; |
| 1429 | } |
| 1430 | } |