[wp-hackers] Data recovery (post_status?)

Sam Angove sam at rephrase.net
Sun Feb 12 14:54:11 GMT 2006

On 2/13/06, Scott Merrill <skippy at skippy.net> wrote:
> When I delete something, I do so because I want it to
> be gone.  A two step delete process (delete, then purge) will become
> cumbersome.

How often do you ever need it to be instantly, irrevocably gone? A
recycle bin hooked to daily/weekly/monthly wp-cron would be no
hardship at all.

There was a story recently about a high-profile blogger (Scott Adams?)
who accidentally deleted a ton of comments over some misunderstanding
of how the software worked. He'd have liked a recycle bin.

Honestly, I think it'd be used far more for comments than posts (I
regularly read of comment-deletion accidents), so extending it to
other types is a good idea.

David House wrote:
> Anyway, we need to decide whether to use post_status (in which case
> we'd need a comment_status, user_status, link_status, etc. for
> everywhere else you want this recycle bin to happen) or whether to
> prepend something like a period to the respective objects' slugs.

How are you going to query a period-prepended post slug? Better to use

Published posts could be safely reverted to drafts if restored:
there's a pretty strong chance they're going to want to edit it.

That said, might as well keep the status in a separate trashed items
table -- something like `trash_id`, `item_type`, `item_status`,
`item_id`, `purge_when`.

A separate table is needed anyway, since individual "date
trashed"/"purge at this time" timestamps are needed if automatic
purging can happen in an intelligent way. And it's a lot cleaner than
querying 5 separate tables for trashed objects.

More information about the wp-hackers mailing list