From 29bcbb62e15a75fe80561d31a3205f099d001a35 Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Thu, 4 Dec 2014 01:58:56 +0000 Subject: [PATCH] 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 --- src/wp-admin/css/customize-controls.css | 12 ++++++++++++ src/wp-includes/class-wp-customize-control.php | 11 ++++++++++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/src/wp-admin/css/customize-controls.css b/src/wp-admin/css/customize-controls.css index d2c1fe86f0..0357c81d53 100644 --- a/src/wp-admin/css/customize-controls.css +++ b/src/wp-admin/css/customize-controls.css @@ -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; } diff --git a/src/wp-includes/class-wp-customize-control.php b/src/wp-includes/class-wp-customize-control.php index 56df6bdd9d..66b9b2fd99 100644 --- a/src/wp-includes/class-wp-customize-control.php +++ b/src/wp-includes/class-wp-customize-control.php @@ -749,12 +749,21 @@ class WP_Customize_Upload_Control extends WP_Customize_Control { if ( data.attachment && data.attachment.id ) { #>
-
+
<# if ( 'image' === data.attachment.type && data.attachment.sizes && data.attachment.sizes.medium ) { #> <# } else if ( 'image' === data.attachment.type && data.attachment.sizes && data.attachment.sizes.full ) { #> + <# } else if ( 'audio' === data.attachment.type ) { #> + +

“{{ data.attachment.title }}”

+ <# if ( data.attachment.album || data.attachment.meta.album ) { #> +

{{ data.attachment.album || data.attachment.meta.album }}

+ <# } #> + <# if ( data.attachment.artist || data.attachment.meta.artist ) { #> +

{{ data.attachment.artist || data.attachment.meta.artist }}

+ <# } #> <# } else { #>

{{ data.attachment.title }}