Make WordPress Core

Changeset 29105


Ignore:
Timestamp:
07/11/2014 09:01:08 PM (10 years ago)
Author:
wonderboymusic
Message:

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.

Location:
trunk/src/wp-includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/js/media-views.js

    r29104 r29105  
    46344634            this.model.on( 'change:title', this._syncTitle, this );
    46354635            this.model.on( 'change:caption', this._syncCaption, this );
     4636            this.model.on( 'change:artist', this._syncArtist, this );
     4637            this.model.on( 'change:album', this._syncAlbum, this );
    46364638            this.model.on( 'change:percent', this.progress, this );
    46374639
  • trunk/src/wp-includes/media-template.php

    r29104 r29105  
    523523            <input type="text" value="{{ data.title }}" {{ maybeReadOnly }} />
    524524        </label>
     525        <# if ( 'audio' === data.type ) { #>
     526        <?php foreach ( array(
     527            'artist' => __( 'Artist' ),
     528            'album' => __( 'Album' ),
     529        ) as $key => $label ) : ?>
     530        <label class="setting" data-setting="<?php echo esc_attr( $key ) ?>">
     531            <span class="name"><?php echo $label ?></span>
     532            <input type="text" value="{{ data.<?php echo $key ?> || data.meta.<?php echo $key ?> || '' }}" />
     533        </label>
     534        <?php endforeach; ?>
     535        <# } #>
    525536        <label class="setting" data-setting="caption">
    526537            <span class="name"><?php _e('Caption'); ?></span>
Note: See TracChangeset for help on using the changeset viewer.