Opened 8 years ago
Closed 8 years ago
#38341 closed defect (bug) (fixed)
Hide 'Empty Trash' button when trash is already empty
Reported by: | swissspidy | Owned by: | swissspidy |
---|---|---|---|
Milestone: | 4.8 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Posts, Post Types | Keywords: | good-first-bug has-patch has-screenshots needs-unit-tests |
Focuses: | ui, administration | Cc: |
Description
Attachments (11)
Change History (31)
#2
follow-up:
↓ 5
@
8 years ago
Patch attached :)
It covers:
- posts
- pages
- comments
I notice something, the code has "Empty Trash" button in "media" as well
But media always deleted permanently so "Empty Trash" for media is never shown up
Is it legacy code?
#5
in reply to:
↑ 2
@
8 years ago
Replying to ivantedja:
But media always deleted permanently so "Empty Trash" for media is never shown up
There's a constant define( 'MEDIA_TRASH', true )
to enable trash for media.
#6
@
8 years ago
Thanks @afercia ! Previously I only saw this info: https://en.support.wordpress.com/trash/#permanently-deleting-an-upload hence I thought there is no way to delete non-permanently
@lukecavanagh attached additional patch for "media"
#7
@
8 years ago
- Keywords needs-screenshots added
- Milestone changed from Awaiting Review to Future Release
@ivantedja Thanks! Would you mind combining these two patches into 1? Makes it easier to test.
#9
@
8 years ago
- Keywords needs-screenshots removed
Patch applies cleanly, screenshots attached, patch refreshed
#14
@
8 years ago
The patch 38341.2.diff did not apply cleanly because it was not created from the project root directory. 38341.3.diff fixes this.
One other thing I noticed is that when restoring the last comment in the comments trash, the button remains since the page is not reloaded. This is only a minor issue, but may be something to consider.
#15
@
8 years ago
Thanks @printsachen1 and good catch with the restore! I think it should be easy to make it work in that scenario, provided that the JS isn't that big of a mess.
#16
@
8 years ago
I've just sent a new diff which hides the Empty Trash button for the use case mentioned by @printsachen1.
When testing I also noticed that when the Pages' trash is empty, there quite a lot of spacing due to the fact that there no button or filter anymore. Is it something that should fixed or is it expected to remain like that? Can be seen on the screenshot posted by @Presskopp.
#18
@
8 years ago
In certain conditions, when an item of Spam was "deleted perminently" and Trash = 0, the "empty spam" button disappeared, even when there was more than one item of spam still in the list.
Note that you'll typically only see this right after emptying the trash. When the trash is already empty, there's not even a link to the trash.