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 { |
841 | 841 | esc_url( wp_get_attachment_url( $post->ID ) ), |
842 | 842 | /* translators: %s: Attachment title. */ |
843 | 843 | esc_attr( sprintf( __( 'Copy “%s” URL to clipboard' ), $att_title ) ), |
844 | | __( 'Copy URL to clipboard' ), |
| 844 | __( 'Copy URL' ), |
845 | 845 | __( 'Copied!' ) |
846 | 846 | ); |
| 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 “%s”' ), $att_title ) ), |
| 853 | __( 'Download' ) |
| 854 | ); |
847 | 855 | } |
848 | 856 | } |
849 | 857 | |