From 42c86e866e75d42f7822f578c40f7d0040ca9329 Mon Sep 17 00:00:00 2001 From: Riad Benguella Date: Fri, 2 Jun 2023 10:28:13 +0100 Subject: [PATCH] Hide the save draft button for published posts (#51193) --- packages/editor/src/components/post-saved-state/index.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/editor/src/components/post-saved-state/index.js b/packages/editor/src/components/post-saved-state/index.js index d3c15b5596e3d..24b88d4d96dee 100644 --- a/packages/editor/src/components/post-saved-state/index.js +++ b/packages/editor/src/components/post-saved-state/index.js @@ -47,8 +47,10 @@ export default function PostSavedState( { isDirty, isNew, isPending, + isPublished, isSaveable, isSaving, + isScheduled, hasPublishAction, } = useSelect( ( select ) => { @@ -103,6 +105,10 @@ export default function PostSavedState( { return null; } + if ( isPublished || isScheduled ) { + return null; + } + /* translators: button label text should, if possible, be under 16 characters. */ const label = isPending ? __( 'Save as pending' ) : __( 'Save draft' );