Skip to content

Commit

Permalink
Hide the save draft button for published posts (WordPress#51193)
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowriad authored and sethrubenstein committed Jul 13, 2023
1 parent b7fb52a commit 10cfff3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/editor/src/components/post-saved-state/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,10 @@ export default function PostSavedState( {
isDirty,
isNew,
isPending,
isPublished,
isSaveable,
isSaving,
isScheduled,
hasPublishAction,
} = useSelect(
( select ) => {
Expand Down Expand Up @@ -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' );

Expand Down

0 comments on commit 10cfff3

Please sign in to comment.