From 528edb0e86e9cd7c20eb74f2219f3fae45e11ecd Mon Sep 17 00:00:00 2001 From: George Mamadashvili Date: Wed, 22 May 2024 19:01:18 +0400 Subject: [PATCH] Post Actions: Hide the trash action for auto-drafts (#61865) Co-authored-by: Mamaduka Co-authored-by: ntsekouras --- packages/editor/src/components/post-actions/actions.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/editor/src/components/post-actions/actions.js b/packages/editor/src/components/post-actions/actions.js index f30df56e67e2e8..926d9b92fe5d13 100644 --- a/packages/editor/src/components/post-actions/actions.js +++ b/packages/editor/src/components/post-actions/actions.js @@ -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,