wp_oembed_add_provider
Adds a URL format and oEmbed provider URL pair.
Description
Parameters (3)
- 0. $format (string)
- The format of URL that this provider can handle. You can use asterisks as wildcards.
- 1. $provider (string)
- The URL to the oEmbed provider.
- 2. $regex — Optional. (bool) =>
false
- Whether the
$format
parameter is in a RegEx format. Default false.
Usage
if ( !function_exists( 'wp_oembed_add_provider' ) ) { require_once ABSPATH . WPINC . '/embed.php'; } // The format of URL that this provider can handle. You can use asterisks // as wildcards. $format = ''; // The URL to the oEmbed provider. $provider = ''; // Optional. Whether the `$format` parameter is in a RegEx format. Default false. $regex = false; // NOTICE! Understand what this does before running. $result = wp_oembed_add_provider($format, $provider, $regex);
Defined (1)
The function is defined in the following location(s).
- /wp-includes/embed.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 );
- }
- }