Make WordPress Core

Changeset 55156


Ignore:
Timestamp:
01/27/2023 11:05:35 PM (22 months ago)
Author:
joedolson
Message:

Media: Add download link to media modal and attachment details.

Make it easier for users to download their uploaded media by providing a download link on the attachment details screen and in the media modal.

Props countrymusicchicago, joedolson, amin7
Fixes #41474.

Location:
trunk/src
Files:
2 edited

Legend:

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

    r55002 r55156  
    33373337        </span>
    33383338    </div>
     3339    <div class="misc-pub-section misc-pub-download">
     3340        <a href="<?php echo esc_attr( $att_url ); ?>" download><?php _e( 'Download file' ); ?></a>
     3341    </div>
    33393342    <div class="misc-pub-section misc-pub-filename">
    33403343        <?php _e( 'File name:' ); ?> <strong><?php echo $filename; ?></strong>
  • trunk/src/wp-includes/media-template.php

    r54526 r55156  
    530530                    <a href="{{ data.editLink }}"><?php _e( 'Edit more details' ); ?></a>
    531531                <# } #>
     532                <# if ( data.can.save && data.link ) { #>
     533                    <span class="links-separator">|</span>
     534                    <a href="{{ data.url }}" download><?php _e( 'Download file' ); ?></a>
     535                <# } #>
    532536                <# if ( ! data.uploading && data.can.remove ) { #>
    533537                    <# if ( data.link || data.can.save ) { #>
Note: See TracChangeset for help on using the changeset viewer.