Youtube Schema Jetpack

Last updated 2 months ago

PHP
	<?php
	if ( ( isset( $url['path'] ) && '/videoseries' == $url['path'] ) || isset( $qargs['list'] ) ) {
		$html = "<span class='embed-youtube' style='$alignmentcss display: block;' itemprop='video' itemscope itemtype='http://schema.org/VideoObject'><iframe class='youtube-player' type='text/html' width='$w' height='$h' src='" . esc_url( set_url_scheme( "http://www.youtube.com/embed/videoseries?list=$id&hl=en_US" ) ) . "' frameborder='0' allowfullscreen='true' itemprop='embedURL'></iframe>
		<meta itemprop='name' content='' />
		<meta itemprop='description' content='' />
		<meta itemprop='uploadDate' content='' />
		<meta itemprop='thumbnailUrl' content='https://img.youtube.com/vi/$id/0.jpg' />
		<meta itemprop='height' content='$h' />
		<meta itemprop='width' content='$w' />
		</span>";
	} else {
		$html = "<span class='embed-youtube' style='$alignmentcss display: block;' itemprop='video' itemscope itemtype='http://schema.org/VideoObject'><iframe class='youtube-player' type='text/html' width='$w' height='$h' src='" . esc_url( set_url_scheme( "http://www.youtube.com/embed/$id?version=3&rel=$rel&fs=1$fmt$autohide&showsearch=$search&showinfo=$info&iv_load_policy=$iv$start$end$hd&wmode=$wmode$theme$autoplay{$cc}{$cc_lang}" ) ) . "' frameborder='0' allowfullscreen='true' itemprop='embedURL'></iframe>
		<meta itemprop='name' content='' />
		<meta itemprop='description' content='' />
		<meta itemprop='uploadDate' content='' />
		<meta itemprop='thumbnailUrl' content='https://img.youtube.com/vi/$id/0.jpg' />
		<meta itemprop='height' content='$h' />
		<meta itemprop='width' content='$w' />
  </span>";
	}

All code snippets are licensed GPLv2 or later unless otherwise stated.