WordPress at a glance

wp_oembed_add_provider() WP 1.0

Adds a URL format and oEmbed provider URL pair.

No Hooks.

Return

null. Nothing.

Usage

wp_oembed_add_provider( $format, $provider, $regex );
$format(string) (required)
The format of URL that this provider can handle. You can use asterisks as wildcards.
$provider(string) (required)
The URL to the oEmbed provider.
$regex(true|false)
Whether the $format parameter is in a RegEx format.
Default: false

Notes

Changelog

Since 2.9.0 Introduced.

Code of wp_oembed_add_provider() WP 5.7.2

<?php
function wp_oembed_add_provider( $format, $provider, $regex = false ) {
	if ( did_action( 'plugins_loaded' ) ) {
		$oembed                       = _wp_oembed_get_object();
		$oembed->providers[ $format ] = array( $provider, $regex );
	} else {
		WP_oEmbed::_add_provider_early( $format, $provider, $regex );
	}
}

From tag: oEmbed (WP response to embed request)

More from category: Other

No comments
    Log In