Created
April 21, 2018 16:24
-
-
Save mattwiebe/e93973d5cf2ddb5f31b6dfa635f52a26 to your computer and use it in GitHub Desktop.
PodBean oEmbed support in WordPress
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
And I'm looking for this for a long time :D Thank you so much!!! Where I put this file in the Wordpress folders?