Skip to content

Instantly share code, notes, and snippets.

@mattwiebe
Created April 21, 2018 16:24
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattwiebe/e93973d5cf2ddb5f31b6dfa635f52a26 to your computer and use it in GitHub Desktop.
Save mattwiebe/e93973d5cf2ddb5f31b6dfa635f52a26 to your computer and use it in GitHub Desktop.
PodBean oEmbed support in WordPress
<?php
/**
* Add Support for PodBean Embed URLs in WordPress.
* Modified from https://core.trac.wordpress.org/ticket/31068#comment:12 to use newer oEmbed endpoint
*
* Just paste an episode URL on a line.
* @link https://core.trac.wordpress.org/ticket/31068#comment:12
* @see wp_oembed_get()
* @param $providers [array] Existing oEmbed Providers
* @return [array] Providers with custom additions
*/
function mw_oembed_providers( $providers ){
$providers['#https?://(.+).podbean.com/e/.+#i'] = array( 'https://api.podbean.com/v1/oembed', true );
return $providers;
}
add_filter( 'oembed_providers', 'mw_oembed_providers' );
@emanuelbg
Copy link

And I'm looking for this for a long time :D Thank you so much!!! Where I put this file in the Wordpress folders?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment