In the Post/Select frames, for audio files:

* Show `artist` and `album` fields in the Attachment Details sidebar
* Sync their values on `change`

See #28839.


git-svn-id: https://develop.svn.wordpress.org/trunk@29105 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Scott Taylor 2014-07-11 21:01:08 +00:00
parent d1f4b3a800
commit 16a70197ed
2 changed files with 13 additions and 0 deletions

View File

@ -4633,6 +4633,8 @@
this.model.on( 'change', this.render, this );
this.model.on( 'change:title', this._syncTitle, this );
this.model.on( 'change:caption', this._syncCaption, this );
this.model.on( 'change:artist', this._syncArtist, this );
this.model.on( 'change:album', this._syncAlbum, this );
this.model.on( 'change:percent', this.progress, this );
// Update the selection.

View File

@ -522,6 +522,17 @@ function wp_print_media_templates() {
<span class="name"><?php _e('Title'); ?></span>
<input type="text" value="{{ data.title }}" {{ maybeReadOnly }} />
</label>
<# if ( 'audio' === data.type ) { #>
<?php foreach ( array(
'artist' => __( 'Artist' ),
'album' => __( 'Album' ),
) as $key => $label ) : ?>
<label class="setting" data-setting="<?php echo esc_attr( $key ) ?>">
<span class="name"><?php echo $label ?></span>
<input type="text" value="{{ data.<?php echo $key ?> || data.meta.<?php echo $key ?> || '' }}" />
</label>
<?php endforeach; ?>
<# } #>
<label class="setting" data-setting="caption">
<span class="name"><?php _e('Caption'); ?></span>
<textarea {{ maybeReadOnly }}>{{ data.caption }}</textarea>