-
-
Save eteubert/d3faac8c90661b357c88d67e8e7a8208 to your computer and use it in GitHub Desktop.
Podlove Publisher: Enable Podtrac Support
This file contains 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 | |
// see https: //analytics.podtrac.com/how-to-measure/ | |
add_filter('podlove_enclosure_url', function ($original_url) { | |
$ext = pathinfo($original_url, PATHINFO_EXTENSION); | |
$schemeless_url = preg_replace('/^https?:\/\//', '', $original_url); | |
$podtrac_prefix = "https://dts.podtrac.com/redirect.$ext/"; | |
return $podtrac_prefix . $schemeless_url; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment