I wanna make a simple shortcode that returns the youtube link in a specified size and use the content. Something like:
[yt]http://youtu.be/Nl29v5pfxTw[/yt]
I have this code, but I want to simplify it:
function youtube($atts) {
extract(shortcode_atts(array(
"value" => 'http://',
"width" => '620',
"height" => '350',
"name"=> 'movie',
"allowFullScreen" => 'true',
"allowScriptAccess"=>'always',
), $atts));
return '<object style="height: '.$height.'px; width: '.$width.'px"><param name="'.$name.'" value="'.$value.'"><param name="allowFullScreen" value="'.$allowFullScreen.'"></param><param name="allowScriptAccess" value="'.$allowScriptAccess.'"></param><embed src="'.$value.'" type="application/x-shockwave-flash" allowfullscreen="'.$allowFullScreen.'" allowScriptAccess="'.$allowScriptAccess.'" width="'.$width.'" height="'.$height.'"></embed></object>';
}
add_shortcode("yt", "youtube");
The problem is that with this code I need to use [yt value="http://youtu.be/Nl29v5pfxTw"] and I want to just use the [yt]$content[/yt]
How I can achieve that?
Thanks