From be70cf26fedd75f8fa101cf29351250fc4c40897 Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Thu, 13 Mar 2014 03:42:14 +0000 Subject: [PATCH] Account for `preload="metadata"` in audio and video shortcodes when multiple versions of the same `` appear on the page by appending a query arg to "cache-bust" passed sources. The query arg is used to make the sources "unique." They will still be cached by the browser and won't bust the cache on every request. Fixes #26779. Built from https://develop.svn.wordpress.org/trunk@27519 git-svn-id: http://core.svn.wordpress.org/trunk@27362 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/media.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/wp-includes/media.php b/wp-includes/media.php index 6526a389b5..f03d6de891 100644 --- a/wp-includes/media.php +++ b/wp-includes/media.php @@ -1469,7 +1469,8 @@ function wp_audio_shortcode( $attr, $content = '' ) { if ( empty( $fileurl ) ) $fileurl = $$fallback; $type = wp_check_filetype( $$fallback, wp_get_mime_types() ); - $html .= sprintf( $source, $type['type'], esc_url( $$fallback ) ); + $url = add_query_arg( '_', $instances, $$fallback ); + $html .= sprintf( $source, $type['type'], esc_url( $url ) ); } } @@ -1657,7 +1658,8 @@ function wp_video_shortcode( $attr, $content = '' ) { } else { $type = wp_check_filetype( $$fallback, wp_get_mime_types() ); } - $html .= sprintf( $source, $type['type'], esc_url( $$fallback ) ); + $url = add_query_arg( '_', $instances, $$fallback ); + $html .= sprintf( $source, $type['type'], esc_url( $url ) ); } }