Skip to content

Commit

Permalink
Post Actions: Hide the trash action for auto-drafts (WordPress#61865)
Browse files Browse the repository at this point in the history
Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>
Co-authored-by: ntsekouras <ntsekouras@git.wordpress.org>
  • Loading branch information
3 people authored and carstingaxion committed Jun 4, 2024
1 parent 2ad48f8 commit 16a1618
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/editor/src/components/post-actions/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ const trashPostAction = {
label: __( 'Move to Trash' ),
isPrimary: true,
icon: trash,
isEligible( { status } ) {
return status !== 'trash';
isEligible( item ) {
return ! [ 'auto-draft', 'trash' ].includes( item.status );
},
supportsBulk: true,
hideModalHeader: true,
Expand Down

0 comments on commit 16a1618

Please sign in to comment.