Advertisement
brasofilo

wpse_78637_temp

Jan 8th, 2013
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.87 KB | None | 0 0
  1. function youtube( $atts, $value = 'http://' ) {
  2.     extract( shortcode_atts( array(
  3.         "width" => '620',
  4.         "height" => '350',
  5.         "name"=> 'movie',
  6.         "allowFullScreen" => 'true',
  7.         "allowScriptAccess"=>'always',
  8.     ), $atts ) );
  9.  
  10.     $output = '
  11.         <object style="height: '
  12.         . $height
  13.         . 'px; width: '
  14.         . $width
  15.         . 'px"><param name="'
  16.         . $name
  17.         . '" value="'
  18.         . $value
  19.         . '"><param name="allowFullScreen" value="'
  20.         . $allowFullScreen
  21.         . '"></param><param name="allowScriptAccess" value="'
  22.         . $allowScriptAccess
  23.         . '"></param><embed src="'
  24.         . $value
  25.         . '" type="application/x-shockwave-flash" allowfullscreen="'
  26.         . $allowFullScreen
  27.         . '" allowScriptAccess="'
  28.         . $allowScriptAccess
  29.         . '" width="'
  30.         . $width
  31.         . '" height="'
  32.         . $height
  33.         . '"></embed></object>';
  34.        
  35.     return $output;
  36. }
  37. add_shortcode( 'yt', 'youtube' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement