Created
August 15, 2010 10:49
-
-
Save jankeesvw/525358 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function drawPortfolioAsset($media_item) { | |
switch ($media_item['type']): | |
case 'image': | |
echo wp_get_attachment_image($media_item['value'], array(640,10000)); | |
break; | |
case 'youtube': | |
echo "<p>"; | |
echo "<object width=\"640\" height=\"504\">"; | |
echo " <param name=\"movie\" value=\"http://www.youtube.com/" . $media_item['value'] . "&hl=en_US&fs=1&rel=0&hd=1;color1=0x3a3a3a&color2=0x999999\"/>"; | |
echo " <param name=\"allowFullScreen\" value=\"true\"/>"; | |
echo " <param name=\"allowscriptaccess\" value=\"always\"/>"; | |
echo " <embed src=\"http://www.youtube.com/v/" . $media_item['value'] . "&hl=en_US&fs=1&rel=0&hd=1;color1=0x3a3a3a&color2=0x999999\" type=\"application/x-shockwave-flash\" allowscriptaccess=\"always\" allowfullscreen=\"true\" width=\"640\" height=\"504\"/>"; | |
echo "</object>"; | |
echo "</p>"; | |
break; | |
case 'snippet': | |
echo $media_item['value']; | |
break; | |
case 'text': | |
echo "<p>".apply_filters('the_content',$media_item['value'])."</p>"; // | |
break; | |
endswitch; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment