Created
November 13, 2012 22:40
-
-
Save whyisjake/4068929 to your computer and use it in GitHub Desktop.
YouTube Playlist Shortcode
This file contains hidden or 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
function youtube_playlist( $atts, $content = null ) { | |
extract( shortcode_atts( array( | |
'width' => '370', | |
'height' => '208', | |
), $atts ) ); | |
return '<iframe width="' . esc_html($width) . '" height="' . esc_html( $height ) . '" src="'. esc_url( 'http://www.youtube.com/embed/videoseries?list=' . $content . '&hl=en_US' ) .'" frameborder="0" allowfullscreen></iframe>'; | |
} | |
add_shortcode( 'youtube_playlist', 'youtube_playlist' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment