Make WordPress Core


Ignore:
Timestamp:
10/19/2020 08:27:34 PM (6 years ago)
Author:
antpb
Message:

Media: Add 'Uploaded to' for individual media items in the media editor.
Adds a link in the media editor showing which post a media item was uploaded to.
Props karmatosed, garrett-eclipse, Mista-Flo, SergeyBiryukov, joemcgill, hellofromTonya.
Fixes #46866.

File:
1 edited

Legend:

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

    r49195 r49207  
    406406                        <div class="details">
    407407                                <h2 class="screen-reader-text"><?php _e( 'Details' ); ?></h2>
     408                                <div class="uploaded"><strong><?php _e( 'Uploaded on:' ); ?></strong> {{ data.dateFormatted }}</div>
     409                                <div class="uploaded-by">
     410                                        <strong><?php _e( 'Uploaded by:' ); ?></strong>
     411                                                <# if ( data.authorLink ) { #>
     412                                                        <a href="{{ data.authorLink }}">{{ data.authorName }}</a>
     413                                                <# } else { #>
     414                                                        {{ data.authorName }}
     415                                                <# } #>
     416                                </div>
     417                                <# if ( data.uploadedToTitle ) { #>
     418                                        <div class="uploaded-to">
     419                                                <strong><?php _e( 'Uploaded to:' ); ?></strong>
     420                                                <# if ( data.uploadedToLink ) { #>
     421                                                        <a href="{{ data.uploadedToLink }}">{{ data.uploadedToTitle }}</a>
     422                                                <# } else { #>
     423                                                        {{ data.uploadedToTitle }}
     424                                                <# } #>
     425                                        </div>
     426                                <# } #>
    408427                                <div class="filename"><strong><?php _e( 'File name:' ); ?></strong> {{ data.filename }}</div>
    409                                 <div class="filename"><strong><?php _e( 'File type:' ); ?></strong> {{ data.mime }}</div>
    410                                 <div class="uploaded"><strong><?php _e( 'Uploaded on:' ); ?></strong> {{ data.dateFormatted }}</div>
    411 
     428                                <div class="file-type"><strong><?php _e( 'File type:' ); ?></strong> {{ data.mime }}</div>
    412429                                <div class="file-size"><strong><?php _e( 'File size:' ); ?></strong> {{ data.filesizeHumanReadable }}</div>
    413430                                <# if ( 'image' === data.type && ! data.uploading ) { #>
    … …  
    486503                                        <textarea id="attachment-details-two-column-description" {{ maybeReadOnly }}>{{ data.description }}</textarea>
    487504                                </span>
    488                                 <span class="setting">
    489                                         <span class="name"><?php _e( 'Uploaded By' ); ?></span>
    490                                         <span class="value">{{ data.authorName }}</span>
    491                                 </span>
    492                                 <# if ( data.uploadedToTitle ) { #>
    493                                         <span class="setting">
    494                                                 <span class="name"><?php _e( 'Uploaded To' ); ?></span>
    495                                                 <# if ( data.uploadedToLink ) { #>
    496                                                         <span class="value"><a href="{{ data.uploadedToLink }}">{{ data.uploadedToTitle }}</a></span>
    497                                                 <# } else { #>
    498                                                         <span class="value">{{ data.uploadedToTitle }}</span>
    499                                                 <# } #>
    500                                         </span>
    501                                 <# } #>
    502505                                <span class="setting" data-setting="url">
    503506                                        <label for="attachment-details-two-column-copy-link" class="name"><?php _e( 'File URL:' ); ?></label>
Note: See TracChangeset for help on using the changeset viewer.