WordPress.org

Make WordPress Core

Opened 3 months ago

#41674 new enhancement

More granular capabilities for restoring and permanently deleting trashed posts

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

Description

Currently the user capability required for restoring a trashed post or permanently deleting a trashed post is delete_post, which maps to delete_posts. There should be a separate capability for each of these actions.

Suggestion:

  • restore_trashed_post which maps to restore_trashed_posts which maps to delete_posts.
  • delete_trashed_post which maps to delete_trashed_posts which maps to delete_posts.

Emptying the trash should use the delete_trashed_posts capability.

This allows for more granular control over which users can or cannot restore or permanently delete posts.

Change History (0)

Note: See TracTickets for help on using tickets.