Make WordPress Core

Opened 7 years ago

Last modified 7 years ago

#48375 new enhancement

Introduce a separate capability for trashing a post

Reported by: johnbillion Owned by:
Priority: normal Milestone: Awaiting Review
Component: Posts, Post Types Version:
Severity: normal Keywords: granular-capabilities needs-patch
Cc: Focuses:

Description

Related: #41674

It's sometimes desirable to allow users to trash posts but not permanently delete them once trashed, nor empty the trash.

There should be a meta capability, trash_post|trash_posts, which by default maps to delete_post|delete_posts which is used when a post is trashed instead of deleted. This would allow a plugin to grant a user the ability to trash posts but not permanently delete them.

Change History (1)

#1 @desrosj
7 years ago

@johnbillion If a user with this capability trashes a post, and the trash is set to automatically empty itself after X days, then users with only this capability would technically still be able to permanently delete a post (though not immediately) because wp_scheduled_delete() does not check who trashed the post.

Because this capability would map to delete_post|delete_posts by default, this may be something that falls into plugin territory. But it came to mind thinking this one through and wanted to mention it here for thought.

Note: See TracTickets for help on using tickets.