WordPress.org

Make WordPress Core

Opened 10 months ago

Last modified 7 months ago

#48375 new enhancement

Introduce a separate capability for trashing a post

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

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 months 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.