Make WordPress Core

Opened 9 years ago

Last modified 13 months ago

#41674 new enhancement

More granular capabilities for restoring and permanently deleting trashed posts

Reported by: johnbillion Owned by:
Priority: normal Milestone: Awaiting Review
Component: Role/Capability Version:
Severity: normal Keywords: needs-patch needs-unit-tests granular-capabilities
Cc: Focuses:

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 (1)

#1 @SirLouen
13 months ago

  • Component Posts, Post Types → Role/Capability
Note: See TracTickets for help on using tickets.