";
return $context;
}
function am_youtube_content_filter($content) {
if (strstr($content,"[am_youtube]") and strstr($content,"[/am_youtube]")){
preg_match_all("/\[am_youtube](.*?)\[\/am_youtube]/",$content, $youtubeMatches);
foreach($youtubeMatches[0] as $youtube)
{
$thisYoutube = str_replace(array("[am_youtube]","[/am_youtube]"),"",$youtube);
$youtubePart = explode('|',$thisYoutube);
$youtubeEmbed = "";
$content = str_replace($youtube,$youtubeEmbed,$content);
}
}
return str_replace(array("[am_youtube]","[/am_youtube]"),"",$content);
}
add_filter( 'the_content', 'am_youtube_content_filter' );
?>