Skip to content

Commit

Permalink
Post Actions: Hide the trash action for auto-drafts (#61865)
Browse files Browse the repository at this point in the history
Co-authored-by: Mamaduka <[email protected]>
Co-authored-by: ntsekouras <[email protected]>
  • Loading branch information
3 people authored May 22, 2024
1 parent 6108134 commit 528edb0
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

1 comment on commit 528edb0

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flaky tests detected in 528edb0.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/9193739964
📝 Reported issues:

Please sign in to comment.