Make WordPress Core

Opened 2 years ago

Last modified 2 months ago

#20175 new defect (bug)

"Trash" should not be a bulk action when user can't delete a post at all

Reported by: markoheijnen Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 3.3.1
Component: Posts, Post Types Keywords: has-patch
Focuses: Cc:


When a user can't delete posts at all for a certain post type the bulk action to delete posts is useless.

Not sure if the following check is correct:

		if ( current_user_can( $post_type_object->cap->delete_post ) ) {
			if ( $this->is_trash || !EMPTY_TRASH_DAYS )
				$actions['delete'] = __( 'Delete Permanently' );
				$actions['trash'] = __( 'Move to Trash' );

Maybe the edit/restore functionality should have some similar check

Attachments (1)

trash-patch.patch (811 bytes) - added by mvd7793 15 months ago.
Fixes the bug in ticket 20175

Download all attachments as: .zip

Change History (6)

comment:1 coffee2code2 years ago

  • Keywords needs-patch added
  • Version set to 3.3.1

comment:2 nacin19 months ago

delete_posts should be plural. Otherwise, seems good at a glance.

mvd779315 months ago

Fixes the bug in ticket 20175

comment:3 mvd779315 months ago

  • Keywords has-patch added; needs-patch removed

comment:4 mvd779315 months ago

  • Cc mvd7793 added

comment:5 nacin2 months ago

  • Component changed from Trash to Posts, Post Types
Note: See TracTickets for help on using tickets.