Make sure `data.meta` always exists when rendering tracklists. Use `$theme_width` when rendering media tag in playlist template instead of recalculating.

Props helen.



git-svn-id: https://develop.svn.wordpress.org/trunk@27269 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Scott Taylor 2014-02-25 19:29:49 +00:00
parent 43e78ac29a
commit 7a21b05378
1 changed files with 2 additions and 2 deletions

View File

@ -1070,9 +1070,9 @@ function wp_get_playlist( $attr, $type ) {
'description' => wptexturize( $attachment->post_content )
);
$track['meta'] = array();
$meta = wp_get_attachment_metadata( $attachment->ID );
if ( ! empty( $meta ) ) {
$track['meta'] = array();
$keys = array( 'title', 'artist', 'band', 'album', 'genre', 'year', 'length', 'length_formatted' );
foreach ( $keys as $key ) {
@ -1154,7 +1154,7 @@ function wp_get_playlist( $attr, $type ) {
<?php if ( 'audio' === $type ): ?>
<div class="wp-playlist-current-item"></div>
<?php endif ?>
<<?php echo $type ?> controls="controls" preload="metadata" width="<?php echo $content_width - $outer ?>"></<?php echo $type ?>>
<<?php echo $type ?> controls="controls" preload="metadata" width="<?php echo $theme_width ?>"></<?php echo $type ?>>
<div class="wp-playlist-next"></div>
<div class="wp-playlist-prev"></div>
<noscript>