Beispiel #1
0
/**
 * Removes an oEmbed provider.
 *
 * @since 3.5.0
 *
 * @see WP_oEmbed
 *
 * @param string $format The URL format for the oEmbed provider to remove.
 * @return bool Was the provider removed successfully?
 */
function wp_oembed_remove_provider($format)
{
    require_once ABSPATH . WPINC . '/class-oembed.php';
    if (did_action('plugins_loaded')) {
        $oembed = _wp_oembed_get_object();
        if (isset($oembed->providers[$format])) {
            unset($oembed->providers[$format]);
            return true;
        }
    } else {
        WP_oEmbed::_remove_provider_early($format);
    }
    return false;
}
Beispiel #2
0
/**
 * Removes an oEmbed provider.
 *
 * @since 3.5.0
 *
 * @see WP_oEmbed
 *
 * @param string $format The URL format for the oEmbed provider to remove.
 * @return bool Was the provider removed successfully?
 */
function wp_oembed_remove_provider($format)
{
    if (did_action('plugins_loaded')) {
        $oembed = _wp_oembed_get_object();
        if (isset($oembed->providers[$format])) {
            unset($oembed->providers[$format]);
            return true;
        }
    } else {
        WP_oEmbed::_remove_provider_early($format);
    }
    return false;
}