#57890 closed defect (bug) (fixed)
Copy URL and Download Media List Table row actions don't appear when the "Unattached" filter is applied
Reported by: | pbiron | Owned by: | pbiron |
---|---|---|---|
Milestone: | 6.3 | Priority: | normal |
Severity: | normal | Version: | 6.0 |
Component: | Media | Keywords: | has-patch needs-testing |
Focuses: | ui, administration | Cc: |
Description
Between 6.2 Beta 5 and RC1, @bobbingwide noticed that the new "Download" row action doesn't appear when the "Unattached" filter is applied. That row action was added in #57574.
While confirming that to be the case, I also discovered that the same problem exists with the "Copy URL" row action added in #54426 (in WP 6.0).
I'll add a patch when I get a chance.
Change History (11)
This ticket was mentioned in PR #4202 on WordPress/wordpress-develop by @kebbet.
20 months ago
#2
- Keywords has-patch added
This ticket was mentioned in PR #4203 on WordPress/wordpress-develop by @pbiron.
20 months ago
#4
#5
follow-up:
↓ 8
@
20 months ago
PR 4203 is similar to the one added by @kebbet. It has 2 differences:
- it doesn't try to remove the redundancy of having the
View
row action specified twice (once when theUnattached
filter is applied and once when any other filters are applied)- this maintains the existing order of the other row actions
- we might want to consider in a future ticket trying to remove the redundancy of adding row actions in the
if ( $this->detached )
andelse
logic, but I don't think this ticket is the proper time to do that
- it displays the 'Download file' row action even when the
Trash
filter is applied...thus giving users one more chance to download the media file before they delete it
#6
@
20 months ago
Thanks for the similar PR @pbiron. Your approach looks better than the one I added. Looking at the code for the View-action, I'm wondering if adding a check for wp_get_attachment_url( $post->ID )
would make sence, just like view
checks for if ( get_permalink( $post->ID ) )
.
So something like this:
<?php if ( wp_get_attachment_url( $post->ID ) ) { $actions['download'] = sprintf( '<a href="%s" aria-label="%s" download>%s</a>', esc_url( wp_get_attachment_url( $post->ID ) ), /* translators: %s: Attachment title. */ esc_attr( sprintf( __( 'Download “%s”' ), $att_title ) ), __( 'Download file' ) ); }
#8
in reply to:
↑ 5
@
20 months ago
Replying to pbiron:
PR 4203 is similar to the one added by @kebbet. It has 2 differences:
- it doesn't try to remove the redundancy of having the
View
row action specified twice (once when theUnattached
filter is applied and once when any other filters are applied)
- this maintains the existing order of the other row actions
- we might want to consider in a future ticket trying to remove the redundancy of adding row actions in the
if ( $this->detached )
andelse
logic, but I don't think this ticket is the proper time to do that- it displays the 'Download file' row action even when the
Trash
filter is applied...thus giving users one more chance to download the media file before they delete it
Future ticket adressing the redundancy: #57893
@SergeyBiryukov commented on PR #4203:
17 months ago
#11
Thanks for the PR! Merged as part of the changes in r55949.
https://core.trac.wordpress.org/ticket/57890