oEmbed Providers

Overview

Use this tool to create custom code to register oEmbed providers with wp_oembed_add_provider() function.

Usage

  • Fill in the user-friendly form.
  • Click the “Update Code” button.
  • Copy the code to your project.
  • Or save it as a snippet and share with the community.

Examples

If you are still learning how to use this tool, check out the following examples:

The function used in the code.
The URL structure that this oEmbed provider supports.
The base URL to the oEmbed provider.
Whether the provider format parameter is a regex string or not.
The URL structure that this oEmbed provider supports.
The base URL to the oEmbed provider.
Whether the provider format parameter is a regex string or not.
The URL structure that this oEmbed provider supports.
The base URL to the oEmbed provider.
Whether the provider format parameter is a regex string or not.
The URL structure that this oEmbed provider supports.
The base URL to the oEmbed provider.
Whether the provider format parameter is a regex string or not.
The URL structure that this oEmbed provider supports.
The base URL to the oEmbed provider.
Whether the provider format parameter is a regex string or not.
  Save Snippet
// Register oEmbed providers
function youtube_oembed_provider() {

	wp_oembed_add_provider( '#https?://(www.)?youtube.com/watch.*#i', 'http://www.youtube.com/oembed/', true );
	wp_oembed_add_provider( '#https?://(www.)?youtube.com/playlist.*#i', 'http://www.youtube.com/oembed/', true );
	wp_oembed_add_provider( '#https?://(www.)?youtu.be/.*#i', 'http://www.youtube.com/oembed/', true );

}
add_action( 'init', 'youtube_oembed_provider' );