wp_oembed_remove_provider( string $format ): bool

Removes an oEmbed provider.

Description

See also

Parameters

$formatstringrequired
The URL format for the oEmbed provider to remove.

Return

bool Was the provider removed successfully?

Source

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;
}

Changelog

VersionDescription
3.5.0Introduced.

User Contributed Notes

  1. Skip to note 2 content

    Removes the WordPress TV provider

    wp_oembed_remove_provider( 'http://wordpress.tv/*' );

You must log in before being able to contribute a note or feedback.