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.

Built from https://develop.svn.wordpress.org/trunk@55198


git-svn-id: http://core.svn.wordpress.org/trunk@54731 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
audrasjb 2023-02-02 22:48:16 +00:00
parent 0874553f76
commit 93234049f2
3 changed files with 12 additions and 3 deletions

View File

@ -842,9 +842,17 @@ class WP_Media_List_Table extends WP_List_Table {
esc_url( wp_get_attachment_url( $post->ID ) ),
/* translators: %s: Attachment title. */
esc_attr( sprintf( __( 'Copy “%s” URL to clipboard' ), $att_title ) ),
__( 'Copy URL to clipboard' ),
__( 'Copy URL' ),
__( 'Copied!' )
);
$actions['download'] = sprintf(
'<a href="%s" aria-label="%s" download>%s</a>',
wp_get_attachment_url( $post->ID ),
/* translators: %s: Attachment title. */
esc_attr( sprintf( __( 'Download &#8220;%s&#8221;' ), $att_title ) ),
__( 'Download file' )
);
}
}

View File

@ -333,7 +333,8 @@ get_current_screen()->add_help_tab(
'<li>' . __( '<strong>Edit</strong> takes you to a simple screen to edit that individual file&#8217;s metadata. You can also reach that screen by clicking on the media file name or thumbnail.' ) . '</li>' .
'<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>' .
'<li>' . __( '<strong>View</strong> will take you to a public display page for that file.' ) . '</li>' .
'<li>' . __( '<strong>Copy URL to clipboard</strong> copies the URL for the media file to your clipboard.' ) . '</li>' .
'<li>' . __( '<strong>Copy URL</strong> copies the URL for the media file to your clipboard.' ) . '</li>' .
'<li>' . __( '<strong>Download file</strong> downloads the original media file to your device.' ) . '</li>' .
'</ul>',
)
);

View File

@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '6.2-alpha-55197';
$wp_version = '6.2-alpha-55198';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.