Make WordPress Core


Ignore:
Timestamp:
02/02/2023 10:46:02 PM (18 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.

File:
1 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            }
Note: See TracChangeset for help on using the changeset viewer.