diff options
author | Anthony G. Basile <blueness@gentoo.org> | 2020-01-06 14:32:30 -0500 |
---|---|---|
committer | Anthony G. Basile <blueness@gentoo.org> | 2020-01-06 14:32:30 -0500 |
commit | 10ef81bf85ad0a4bad0d204838e14c99ca2526f7 (patch) | |
tree | b4bb36a326d41de12d1a6181d2a2baf34696ac24 /plugins/jetpack/modules/shortcodes/twitchtv.php | |
parent | Updating script for Update (diff) | |
download | blogs-gentoo-10ef81bf85ad0a4bad0d204838e14c99ca2526f7.tar.gz blogs-gentoo-10ef81bf85ad0a4bad0d204838e14c99ca2526f7.tar.bz2 blogs-gentoo-10ef81bf85ad0a4bad0d204838e14c99ca2526f7.zip |
Update jetpack 8.0
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
Diffstat (limited to 'plugins/jetpack/modules/shortcodes/twitchtv.php')
-rw-r--r-- | plugins/jetpack/modules/shortcodes/twitchtv.php | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/plugins/jetpack/modules/shortcodes/twitchtv.php b/plugins/jetpack/modules/shortcodes/twitchtv.php index a5439d05..935a8b3a 100644 --- a/plugins/jetpack/modules/shortcodes/twitchtv.php +++ b/plugins/jetpack/modules/shortcodes/twitchtv.php @@ -1,20 +1,24 @@ <?php /** - * twitch.tv shortcode - * [twitchtv url='http://www.twitch.tv/paperbat' height='378' width='620' autoplay='false'] - * [twitchtv url='http://www.twitch.tv/paperbat/b/323486192' height='378' width='620' autoplay='false'] - **/ + * Twitch.tv shortcode + * + * Examples: + * [twitchtv url='https://www.twitch.tv/paperbat' height='378' width='620' autoplay='false'] + * [twitchtv url='https://www.twitch.tv/paperbat/b/323486192' height='378' width='620' autoplay='false'] + * + * @package Jetpack + */ /** - * (Live URL) http://www.twitch.tv/paperbat + * (Live URL) https://www.twitch.tv/paperbat * * <iframe src="https://player.twitch.tv/?autoplay=false&muted=false&channel=paperbat" width="620" height="378" frameborder="0" scrolling="no" allowfullscreen></iframe> * - * (Archive URL) http://www.twitch.tv/paperbat/v/323486192 + * (Archive URL) https://www.twitch.tv/paperbat/v/323486192 * * <iframe src="https://player.twitch.tv/?autoplay=false&muted=false&video=v323486192" width="620" height="378" frameborder="0" scrolling="no" allowfullscreen></iframe> * - * @param $atts array User supplied shortcode arguments. + * @param array $atts User supplied shortcode arguments. * * @return string HTML output of the shortcode. */ @@ -35,7 +39,7 @@ function wpcom_twitchtv_shortcode( $atts ) { return '<!-- Invalid twitchtv URL -->'; } - preg_match( '|^http://www.twitch.tv/([^/?]+)(/v/(\d+))?|i', $attr['url'], $match ); + preg_match( '|^https?://www.twitch.tv/([^/?]+)(/v/(\d+))?|i', $attr['url'], $match ); $url_args = array( 'autoplay' => ( false !== $attr['autoplay'] && 'false' !== $attr['autoplay'] ) ? 'true' : 'false', @@ -69,6 +73,5 @@ function wpcom_twitchtv_shortcode( $atts ) { esc_attr( $height ) ); } - add_shortcode( 'twitch', 'wpcom_twitchtv_shortcode' ); add_shortcode( 'twitchtv', 'wpcom_twitchtv_shortcode' ); |