Make WordPress Core


Ignore:
Timestamp:
07/11/2014 08:54:13 PM (12 years ago)
Author:
wonderboymusic
Message:

Media Grid, for audio files:

  • Show artist and album fields in the Edit Attachment modal
  • Sync their values on change

See #28839.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/media-template.php

    r29088 r29104  
    338338                <input type="text" value="{{ data.title }}" {{ maybeReadOnly }} />
    339339            </label>
     340            <# if ( 'audio' === data.type ) { #>
     341            <?php foreach ( array(
     342                'artist' => __( 'Artist' ),
     343                'album' => __( 'Album' ),
     344            ) as $key => $label ) : ?>
     345            <label class="setting" data-setting="<?php echo esc_attr( $key ) ?>">
     346                <span class="name"><?php echo $label ?></span>
     347                <input type="text" value="{{ data.<?php echo $key ?> || data.meta.<?php echo $key ?> || '' }}" />
     348            </label>
     349            <?php endforeach; ?>
     350            <# } #>
    340351            <label class="setting" data-setting="caption">
    341352                <span class="name"><?php _e('Caption'); ?></span>
     
    353364            </label>
    354365            <label class="setting">
    355                     <span class="name"><?php _e( 'Uploaded By' ); ?></span>
    356                     <span class="value">{{ data.authorName }}</span>
    357                 </label>
     366                <span class="name"><?php _e( 'Uploaded By' ); ?></span>
     367                <span class="value">{{ data.authorName }}</span>
     368            </label>
    358369            <# if ( data.uploadedTo ) { #>
    359370                <label class="setting">
     
    362373                </label>
    363374            <# } #>
     375
    364376        </div>
    365377    </script>
Note: See TracChangeset for help on using the changeset viewer.