Make WordPress Core

Changeset 55198


Ignore:
Timestamp:
02/02/2023 10:46:02 PM (22 months ago)
Author:
audrasjb
Message:

Media: Add a Download row action to the Media List Table.

This changeset makes it easier for users to download their uploaded media by providing a Download row action to the Media List Table. It also rephrases the Copy URL row action for better consistency and to give room for the new Download action.

Follow-up to [55156].

Props pbiron, joedolson, kebbet, Mista-Flo, costdev, amin7, mukesh27.
Fixes #57574.

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

Legend:

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

    r55159 r55198  
    843843                    /* translators: %s: Attachment title. */
    844844                    esc_attr( sprintf( __( 'Copy “%s” URL to clipboard' ), $att_title ) ),
    845                     __( 'Copy URL to clipboard' ),
     845                    __( 'Copy URL' ),
    846846                    __( 'Copied!' )
     847                );
     848
     849                $actions['download'] = sprintf(
     850                    '<a href="%s" aria-label="%s" download>%s</a>',
     851                    wp_get_attachment_url( $post->ID ),
     852                    /* translators: %s: Attachment title. */
     853                    esc_attr( sprintf( __( 'Download &#8220;%s&#8221;' ), $att_title ) ),
     854                    __( 'Download file' )
    847855                );
    848856            }
  • trunk/src/wp-admin/upload.php

    r55183 r55198  
    334334                    '<li>' . __( '<strong>Delete Permanently</strong> will delete the file from the media library (as well as from any posts to which it is currently attached).' ) . '</li>' .
    335335                    '<li>' . __( '<strong>View</strong> will take you to a public display page for that file.' ) . '</li>' .
    336                     '<li>' . __( '<strong>Copy URL to clipboard</strong> copies the URL for the media file to your clipboard.' ) . '</li>' .
     336                    '<li>' . __( '<strong>Copy URL</strong> copies the URL for the media file to your clipboard.' ) . '</li>' .
     337                    '<li>' . __( '<strong>Download file</strong> downloads the original media file to your device.' ) . '</li>' .
    337338                '</ul>',
    338339    )
Note: See TracChangeset for help on using the changeset viewer.