WordPress.org

Make WordPress Core

Opened 4 years ago

Last modified 5 days ago

#15930 new enhancement

Make trashed posts/pages still readable

Reported by: JonezJeA Owned by:
Milestone: Future Release Priority: normal
Severity: minor Version: 2.9
Component: Posts, Post Types Keywords: needs-patch make-flow
Focuses: administration Cc:

Description

I hoped I was able to see the pages which I delete (in the trashbin) but the all stay dark... So I can't view them!

I think it would be a good feature to see them to see if somebody didn't delete the wrong page! Or when you need something form a deleted page that you can still get it without restoring it first

Attachments (1)

15930.diff (7.2 KB) - added by ryan 2 weeks ago.

Download all attachments as: .zip

Change History (13)

comment:1 @johnbillion4 years ago

  • Cc johnbillion@… added

comment:2 @nacin4 years ago

  • Keywords 2nd-opinion added
  • Milestone changed from Awaiting Review to Future Release
  • Type changed from defect (bug) to enhancement

comment:3 @ocean9013 months ago

  • Component changed from General to Posts, Post Types
  • Focuses administration added
  • Summary changed from Deleted page bin view? to Make trashed posts/pages still readable

comment:4 follow-up: @ericlewis12 months ago

  • Severity changed from normal to minor

@JonezJeA What do mean by "readable"? You want to be able to go into the edit post screen for a trashed post?

I would suggest using the "draft" post status to inspect/edit a post's contents without publishing it.

However, this does bring up a minor UI/UX issue: when a post is in the trash, the user's only option is to "restore" the post's pre-trash status. Something that was once published that you trashed, you might want to take a look at again, but restoring it would mean making it a live post again, and then immediately change the post status to draft.

comment:5 in reply to: ↑ 4 @SergeyBiryukov12 months ago

Replying to ericlewis:

Something that was once published that you trashed, you might want to take a look at again, but restoring it would mean making it a live post again, and then immediately change the post status to draft.

Related: #22350, #23022.

comment:6 @wpkonsulent5 months ago

I'm surprised this hasn't gained more traction. I have lots of clients with huge sites and many, many editors who have this problem all the time. Suppose someone trashes a page and the head editor wants to see the content of the trashed page, just to make sure it wasn't trashed by accident. She can't do that without untrashing it and thereby publishing it again, which could bring all sorts of trouble on a large site. Some times there are even several trashed pages with the same name which only makes the problem worse.

Why can't we preview trashed pages, just like we can preview drafts? I'm curious what the reason might be, you know, design-wise.

Always setting post status to draft when untrashing (as suggested by #23022) is sort of fine, but IMO it would be a nice addition if we could also just preview the page without untrashing it. Just to be clear, I'm only suggesting the page to be previewed on the front end. Being able to actually edit trashed pages would probably lead to confusion, so that's not what I'm proposing.

I'd be interested in making a patch for this, btw.

comment:7 @johnbillion4 months ago

  • Keywords needs-patch added; 2nd-opinion removed
  • Version changed from 3.0.3 to 2.9

Agreed. Users should be able to view a trashed post using the same or similar mechanism as previewing a draft post.

A patch would be very welcome.

comment:8 @ryan3 weeks ago

  • Keywords make-flow added

@ryan2 weeks ago

comment:10 @ryan2 weeks ago

Attached is a quick exploration of making trashed posts editable and viewable. This required changing the 'trash' post status object from internal to protected.

  • Edit, Quick Edit, and view now show in the posts list table for trashed posts.
  • In the editor, Move to Trash is hidden for trashed posts.
  • In the editor, trashed posts now show Trash for status.
  • In the editor, trashed posts can be changed to Pending Review or Draft status.
  • In the editor, the Publish button never shows for trashed posts. Update always shows instead. Basically, trashed posts can move to pending or draft but not straight to published.
  • A partial attempt was made to add preview=true to view links for trashed posts.
  • WP_Posts_List_Table::inline_edit() needs Trash awareness added to the status selector.
  • Pages totally untouched.
Last edited 2 weeks ago by ryan (previous) (diff)

comment:11 follow-up: @krogsgard6 days ago

For an added use case, I recently ran into this on an "Order" post type in an eCommerce plugin. In that instance, I really had no idea what would happen or be triggered if I restored it. So being able to adjust the status to other available options would've been super useful.

comment:12 in reply to: ↑ 11 @ryan5 days ago

Replying to krogsgard:

For an added use case, I recently ran into this on an "Order" post type in an eCommerce plugin. In that instance, I really had no idea what would happen or be triggered if I restored it. So being able to adjust the status to other available options would've been super useful.

I'd certainly be nervous to restore a custom post type from trash given the current behavior.

My patch contribution is limited to that quick exploration. Others, feel free to run with it.

Note: See TracTickets for help on using tickets.