WordPress.org

Make WordPress Core

Changeset 21351


Ignore:
Timestamp:
07/26/2012 08:18:27 PM (6 years ago)
Author:
ryan
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/media.php

    r21014 r21351  
    14211421
    14221422/**
     1423 * Removes an oEmbed provider.
     1424 *
     1425 * @since 3.5
     1426 * @see WP_oEmbed
     1427 *
     1428 * @uses _wp_oembed_get_object()
     1429 *
     1430 * @param string $format The URL format for the oEmbed provider to remove.
     1431 */
     1432function wp_oembed_remove_provider( $format ) {
     1433    require_once( ABSPATH . WPINC . '/class-oembed.php' );
     1434
     1435    $oembed = _wp_oembed_get_object();
     1436
     1437    if ( isset( $oembed->providers[ $format ] ) ) {
     1438        unset( $oembed->providers[ $format ] );
     1439        return true;
     1440    }
     1441
     1442    return false;
     1443}
     1444
     1445/**
    14231446 * Determines if default embed handlers should be loaded.
    14241447 *
Note: See TracChangeset for help on using the changeset viewer.