Show title, album, and artist info for audio files displayed in WP_Customize_Upload_Control().

See #21483.


git-svn-id: https://develop.svn.wordpress.org/trunk@30737 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Scott Taylor 2014-12-04 01:58:56 +00:00
parent 2ec473b538
commit 29bcbb62e1
2 changed files with 22 additions and 1 deletions

View File

@ -430,6 +430,18 @@ p.customize-section-description {
padding: 5px 10px;
}
.customize-control .attachment-meta {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
margin: 0;
padding: 5px 10px 0;
}
.customize-control .attachment-meta-title {
padding-top: 7px;
}
.customize-control .thumbnail-image {
line-height: 0;
}

View File

@ -749,12 +749,21 @@ class WP_Customize_Upload_Control extends WP_Customize_Control {
if ( data.attachment && data.attachment.id ) { #>
<div class="current">
<div class="container">
<div class="attachment-media-view {{ data.attachment.orientation }}">
<div class="attachment-media-view attachment-media-view-{{ data.attachment.type }} {{ data.attachment.orientation }}">
<div class="thumbnail thumbnail-{{ data.attachment.type }}">
<# if ( 'image' === data.attachment.type && data.attachment.sizes && data.attachment.sizes.medium ) { #>
<img class="attachment-thumb" src="{{ data.attachment.sizes.medium.url }}" draggable="false" />
<# } else if ( 'image' === data.attachment.type && data.attachment.sizes && data.attachment.sizes.full ) { #>
<img class="attachment-thumb" src="{{ data.attachment.sizes.full.url }}" draggable="false" />
<# } else if ( 'audio' === data.attachment.type ) { #>
<img class="attachment-thumb type-icon" src="{{ data.attachment.icon }}" class="icon" draggable="false" />
<p class="attachment-meta attachment-meta-title">&#8220;{{ data.attachment.title }}&#8221;</p>
<# if ( data.attachment.album || data.attachment.meta.album ) { #>
<p class="attachment-meta"><em>{{ data.attachment.album || data.attachment.meta.album }}</em></p>
<# } #>
<# if ( data.attachment.artist || data.attachment.meta.artist ) { #>
<p class="attachment-meta">{{ data.attachment.artist || data.attachment.meta.artist }}</p>
<# } #>
<# } else { #>
<img class="attachment-thumb type-icon" src="{{ data.attachment.icon }}" class="icon" draggable="false" />
<p class="attachment-title">{{ data.attachment.title }}</p>