diff options
author | Anthony G. Basile <blueness@gentoo.org> | 2016-04-18 11:52:28 -0400 |
---|---|---|
committer | Anthony G. Basile <blueness@gentoo.org> | 2016-04-18 11:52:28 -0400 |
commit | 097e7d91b32dd6d27ea47e5d7cd8d6bdcf1e50a2 (patch) | |
tree | edf0e0c9fcd6ce7c922593a4df301d624e9faeb1 /plugins/jetpack/modules/shortcodes/youtube.php | |
parent | Update pluging wordpress-mobile-pack to 2.2.2 (diff) | |
download | blogs-gentoo-097e7d91b32dd6d27ea47e5d7cd8d6bdcf1e50a2.tar.gz blogs-gentoo-097e7d91b32dd6d27ea47e5d7cd8d6bdcf1e50a2.tar.bz2 blogs-gentoo-097e7d91b32dd6d27ea47e5d7cd8d6bdcf1e50a2.zip |
Update plugin jetpack to 3.9.6
Diffstat (limited to 'plugins/jetpack/modules/shortcodes/youtube.php')
-rw-r--r-- | plugins/jetpack/modules/shortcodes/youtube.php | 40 |
1 files changed, 25 insertions, 15 deletions
diff --git a/plugins/jetpack/modules/shortcodes/youtube.php b/plugins/jetpack/modules/shortcodes/youtube.php index 601427ba..2ea76dd6 100644 --- a/plugins/jetpack/modules/shortcodes/youtube.php +++ b/plugins/jetpack/modules/shortcodes/youtube.php @@ -292,22 +292,32 @@ function youtube_id( $url ) { if ( apply_filters( 'jetpack_youtube_allow_autoplay', false ) && isset( $qargs['autoplay'] ) ) $autoplay = '&autoplay=' . (int)$qargs['autoplay']; - $alignmentcss = 'text-align:center;'; - if ( isset( $qargs['align'] ) ) { - switch ( $qargs['align'] ) { - case 'left': - $alignmentcss = "float:left; width:{$w}px; height:{$h}px; margin-right:10px; margin-bottom: 10px;"; - break; - case 'right': - $alignmentcss = "float:right; width:{$w}px; height:{$h}px; margin-left:10px; margin-bottom: 10px;"; - break; - } - } - if ( ( isset( $url['path'] ) && '/videoseries' == $url['path'] ) || isset( $qargs['list'] ) ) { - $html = "<span class='embed-youtube' style='$alignmentcss display: block;'><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'></iframe></span>"; + $html = "<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" ) ) . "' allowfullscreen='true' style='border:0;'></iframe>"; } else { - $html = "<span class='embed-youtube' style='$alignmentcss display: block;'><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'></iframe></span>"; + $html = "<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}" ) ) . "' allowfullscreen='true' style='border:0;'></iframe>"; + } + + // Let's do some alignment wonder in a span, unless we're producing a feed + if ( ! is_feed() ) { + $alignmentcss = 'text-align:center;'; + if ( isset( $qargs['align'] ) ) { + switch ( $qargs['align'] ) { + case 'left': + $alignmentcss = "float:left; width:{$w}px; height:{$h}px; margin-right:10px; margin-bottom: 10px;"; + break; + case 'right': + $alignmentcss = "float:right; width:{$w}px; height:{$h}px; margin-left:10px; margin-bottom: 10px;"; + break; + } + } + + $html = sprintf( + '<span class="embed-youtube" style="%s display: block;">%s</span>', + esc_attr( $alignmentcss ), + $html + ); + } /** @@ -363,7 +373,7 @@ if ( apply_filters( 'jetpack_comments_allow_oembed', get_option('embed_autourls' /** * Core changes to do_shortcode (https://core.trac.wordpress.org/changeset/34747) broke "improper" shortcodes - * with the format [shortcode=http://url.com]. + * with the format [shortcode=http://url.com]. * * This removes the "=" from the shortcode so it can be parsed. * |