function youtube_shortcode($atts) { extract(shortcode_atts(array("id" => null, "height" => '', "width" => '', "rel" => 0, "ignore_visibility" => '', "class" => ''), $atts)); $width = 'width="' . $width . '"'; $height = 'height="' . $height . '"'; $flags = get_flags($atts); if (in_array('ignore_visibility', $flags)) { $ignore_visibility = 'ignore-visibility'; } $youtube = '<article class="nebula-youtube youtube video"><iframe id="' . youtube_meta($id, 'safetitle') . '" class="youtubeplayer ' . $class . ' ' . $ignore_visibility . '" ' . $width . ' ' . $height . ' src="//www.youtube.com/embed/' . youtube_meta($id, 'id') . '?wmode=transparent&enablejsapi=1&origin=' . youtube_meta($id, 'origin') . '&rel=' . $rel . '" frameborder="0" allowfullscreen=""></iframe></article>'; return $youtube; }
<span style="display: block; font-size: 12px; line-height: 18px;"> by <?php echo youtube_meta($youtube_id, 'author'); ?> <br /> <?php echo youtube_meta($youtube_id, 'description'); ?> </span> </div><!--/columns--> </div><!--/row--> </div><!--/container--> <?php } ?> </div><!--/columns--> </div><!--/row--> <div class="row"> <div class="sixteen columns"> <br /> <h4>Available Data</h4> <p>Using the 'json' parameter: <?php echo do_shortcode("[code]youtube_meta('fjh61K3hyY0', 'json')[/code]"); ?> </p> <?php echo do_shortcode('[pre lang=js]' . json_encode(youtube_meta('fjh61K3hyY0', 'json'), JSON_PRETTY_PRINT) . '[/pre]'); ?> </div><!--/columns--> </div><!--/row-->