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

Props helen.


Built from https://develop.svn.wordpress.org/trunk@27269


git-svn-id: http://core.svn.wordpress.org/trunk@27125 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Scott Taylor 2014-02-25 19:30:14 +00:00
parent acb65e13c3
commit c4cd842c29
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 ) 'description' => wptexturize( $attachment->post_content )
); );
$track['meta'] = array();
$meta = wp_get_attachment_metadata( $attachment->ID ); $meta = wp_get_attachment_metadata( $attachment->ID );
if ( ! empty( $meta ) ) { if ( ! empty( $meta ) ) {
$track['meta'] = array();
$keys = array( 'title', 'artist', 'band', 'album', 'genre', 'year', 'length', 'length_formatted' ); $keys = array( 'title', 'artist', 'band', 'album', 'genre', 'year', 'length', 'length_formatted' );
foreach ( $keys as $key ) { foreach ( $keys as $key ) {
@ -1154,7 +1154,7 @@ function wp_get_playlist( $attr, $type ) {
<?php if ( 'audio' === $type ): ?> <?php if ( 'audio' === $type ): ?>
<div class="wp-playlist-current-item"></div> <div class="wp-playlist-current-item"></div>
<?php endif ?> <?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-next"></div>
<div class="wp-playlist-prev"></div> <div class="wp-playlist-prev"></div>
<noscript> <noscript>