-
Notifications
You must be signed in to change notification settings - Fork 37
Improve UX for deleting posts #172
Comments
The way that works is to set the post status to trash which will clean up any newly created or existing posts when the state is saved. |
Just change the Post Status to Trash?
Actually no, they just have to change the Post Status to Trash.
Yeah, this can be done by changing the Post Status to Trash: I think the confusion here may be that users don't expect “Trash” to be among the status dropdown. Maybe there should be a shortcut link like “Move to trash” that would select this status for them? |
@valendesigns OK got it. Though not very intuitive or consistent from a UI perspective. I couldn't find it :-) |
It's not consistent but we can add the trash link to fix that which would select trash in the post status for now. We'll do more work on that control in the future. We still need to sync back to the admin and this would be a good time to address the big picture concerns. |
Cool, thanks for the feedback. I just tested selecting the "Trash" post status on a newly-created page and clicking Save & Publish and it actually puts the page in the Trash. Which means it's still creating a post in the database. So when a user clicks "Add New Post" they only have two options to back out: A. Have the post written to their database as a "Trash" post. There is no way to completely discard it without a database write as far as I can see in my testing. |
The post is technically in the DB already, because it's created as a |
Good find! So I think the solution here is simple: we can just modify the |
I'll have a PR shortly. |
I also started a WIP branch for adding a Move to Trash link: bugfix/delete-trashed-auto-drafts...feature/trash-link We'd need to keep track of whether or not the post was saved yet, and of not, show a Delete link instead. And then if the post is moved to the trash, then should there be a Restore link to change the status back from Trash to Draft or something? |
@westonruter Nice! Well, my initial reaction/thought about this was: The shortcut link doesn't really solve much other than lessening the obscurity of the Trash option in a collapsed dropdown. The user clicks the link, then what? They are likely going to click the back button to view the post list. So why not just do this in one click?
Regarding how to handle editing a post that's currently trashed, this one seems tricky to me. I know that in the WP Admin you can't even edit a trashed post until it's been restored. So should the Customizer behave the same way? I'm not really sure, but I do have a mock 😄 |
@fjarrett your mock of having controls disabled is similar to what @valendesigns had initially (see acb3aef), aside from the Restore button. The problem we had was disabling the fields in the controls is not immediately straightforward, since there is no We'd also need to develop a custom control for Post Status since right now it is using a standard |
I think we can leave the Trashed status in the dropdown, but we can just add a link which will update the status to |
I'm picking this up now. |
Thanks to #48 the user can now create new posts and pages. But what if they want to then discard a newly drafted post/page?
With the current implementation, in order to "undo" a newly created post/page the user must leave the Customizer and discard all other changes that they might have staged in the session.
Additionally, it seems reasonable that the user should be able to trash posts/pages that are pre-existing, just as they can inside
post.php
.The text was updated successfully, but these errors were encountered: