by
KK » Tue Apr 24, 2012 7:14 pm
Hi pimb and welcome

Try this as shortcode for vimeo
- Code: Select all
// Usage: [vimeo 40613192]
$FUNCS->register_shortcode( 'vimeo', 'vimeo_handler' );
function vimeo_handler( $params, $content=null ){
global $FUNCS;
extract( $FUNCS->get_named_vars(array(
'id'=>'',
'width' => '475',
'height' => '350',
), $params) );
// Sanitize parameters
$id = htmlspecialchars( $id, ENT_QUOTES );
$width = (int)$width;
$height = (int)$height;
// Output HTML
$html =<<<EOS
<iframe src="//player.vimeo.com/video/$id?byline=0&portrait=0&badge=0" width="$width" height="$height" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>
EOS;
return $html;
}
Hope this helps. Let us know.
Note: (May 10, 2013) Revised the code to output the currently used markup for Vimeo videos, as suggested by @cheesypoof.