Account for `preload="metadata"` in audio and video shortcodes when multiple versions of the same `<source>` 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.



git-svn-id: https://develop.svn.wordpress.org/trunk@27519 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Scott Taylor 2014-03-13 03:41:53 +00:00
parent abf794f75c
commit d018152785
1 changed files with 4 additions and 2 deletions

View File

@ -1469,7 +1469,8 @@ function wp_audio_shortcode( $attr, $content = '' ) {
if ( empty( $fileurl ) ) if ( empty( $fileurl ) )
$fileurl = $$fallback; $fileurl = $$fallback;
$type = wp_check_filetype( $$fallback, wp_get_mime_types() ); $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 { } else {
$type = wp_check_filetype( $$fallback, wp_get_mime_types() ); $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 ) );
} }
} }