Opened 3 months ago
Closed 3 months ago
#64453 closed defect (bug) (reported-upstream)
Label of button 'Move to trash' on Settings Panel in Block Editor not changed when constant EMPTY_TRASH_DAYS is defined as false
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Priority: | normal | |
| Severity: | normal | Version: | 6.9 |
| Component: | Editor | Keywords: | |
| Focuses: | ui, javascript | Cc: |
Description
The Move to Trash button in the Settings Panel in the Block Editor doesnt display the proper text when the constant 'EMPTY_TRASH_DAYS' is defined as false. This constant, when set to false disables the trash function. In the classic editor the button's label is changed from 'Move to trash' to 'Delete permanently'. This doesnt happen in the Block Editor. The button's label remains 'Move to trash' irrespective of the value of 'EMPTY_TRASH_DAYS'. The button actually does do its job, but the browser confirmation message must be altered, as well as the admin notification when redirected to the All Posts page after the button has been pressed.
Bug instructions:
- Add following snippet in wp-config.php: define('EMPTY_TRASH_DAYS', false );
- Open post in Block Editor
- Goto Settings Panel > Post. Find the red button labelled 'Move to trash'. It should have been renamed to 'Delete Permanently'.
- Clicking on it triggers a confirmation window. The message is 'Are you sure you want to move "[post title]" to the trash?'. It should be 'Are you sure you want to permanently delete "[post title]"?'. The button should also be renamed to 'delete permanently'.
Attachments (1)
Change History (4)
Note: See
TracTickets for help on using
tickets.
Hi @ignatiusjeroe, Thanks for the issue.
Firstly, EMPTY_TRASH_DAYS as per https://codex.wordpress.org/Trash_status#:~:text=(int)%20%3E%3D%200%C2%A0%3A%20the%20length%20of%20days%20before%20items%20are%20permanently%20deleted.%20Default%C2%A0%3A%2030, the EMPTY_TRASH_DAYS should be int (>=0) instead of boolean. Though,
I can verify this indeed an issue, as if we add
0to the constant, which means that no place for trashing, directly delete, the action is performed correctly in post editor, but the notifications, labels and even admin notice says the item is moved to trash. We need to change it to proper labels.IMO, this should be raised in upstream GB repository, I will create the issue there and will add the link.