"", "https" => "off", "width" => "640", "height" => "360", "scrolling" => "no", "class" => "acast-embed-player", "style" => "border:none; overflow:hidden;", "frameborder" => "0" ); foreach ($defaults as $key => $value) { if (!@array_key_exists($key, $attr)) { $attr[$key] = $value; } } $re = "/^((https?:\/\/)?(www\.|embed\.)?acast\.com)?\/?([^\/]+)\/([^\?\/]+)/"; if (!preg_match($re, $attr["src"], $matches)) { return "[ACAST ERROR] No acast provided"; } $http = $attr["https"] == "on" ? "https://" : "http://"; //Create embed url $channel = $matches[4]; $acast = $matches[5]; $src = $http . "embed.acast.com/" . $channel . "/" . $acast; $rss = $http . "rss.acast.com/" . $channel . "/" . $acast . "/media.mp3"; //Responsive? $responsive = ($attr["width"] == "100%" || $attr["responsive"] == "on"); if ($responsive) { //iframe $attr["height"] = "auto"; $attr["width"] = "100%"; $attr["style"].= implode(";", array( "position:absolute", "top:0", "left:0", "width:100%", "height:100%" )); //Wrapper $style_wrapper = implode(";", array( "width:100%", "position:relative", "padding-bottom:56.25%", "height:0", "overflow:hidden" )); $html .= "
"; } return $html; } add_shortcode("acast", "acast_embed_shortcode" ); endif;