Make WordPress Core

Ticket #57574: 57574.diff

File 57574.diff, 1.4 KB (added by pbiron, 20 months ago)
  • src/wp-admin/includes/class-wp-media-list-table.php

    From 8a4438f0a4132caeb7d528e35dddaf0b14cab1b3 Mon Sep 17 00:00:00 2001
    From: Paul Biron <paul@sparrowhawkcomputing.com>
    Date: Fri, 27 Jan 2023 17:35:24 -0700
    Subject: [PATCH] Adds a Download row action to the Media List Table.
    
    Also shortens the "Copy URL to Clipboard" row action to "Copy URL", so that row actions aren't as cluttered.
    ---
     src/wp-admin/includes/class-wp-media-list-table.php | 10 +++++++++-
     1 file changed, 9 insertions(+), 1 deletion(-)
    
    diff --git a/src/wp-admin/includes/class-wp-media-list-table.php b/src/wp-admin/includes/class-wp-media-list-table.php
    index 0330b67f3b..a904decc5d 100644
    a b class WP_Media_List_Table extends WP_List_Table { 
    841841                                        esc_url( wp_get_attachment_url( $post->ID ) ),
    842842                                        /* translators: %s: Attachment title. */
    843843                                        esc_attr( sprintf( __( 'Copy &#8220;%s&#8221; URL to clipboard' ), $att_title ) ),
    844                                         __( 'Copy URL to clipboard' ),
     844                                        __( 'Copy URL' ),
    845845                                        __( 'Copied!' )
    846846                                );
     847
     848                                $actions['download'] = sprintf(
     849                                        '<a href="%s" aria-label="%s" download>%s</a>',
     850                                        wp_get_attachment_url( $post->ID ),
     851                                        /* translators: %s: Attachment title. */
     852                                        esc_attr( sprintf( __( 'Download &#8220;%s&#8221;' ), $att_title ) ),
     853                                        __( 'Download' )
     854                                );
    847855                        }
    848856                }
    849857