Skip to content

Commit

Permalink
Hide the save draft button for published posts
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowriad committed Jun 2, 2023
1 parent 0ed6266 commit deaa32d
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 deaa32d

Please sign in to comment.