Skip to content

Commit

Permalink
Hide the save draft button for published posts (#51193)
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowriad authored Jun 2, 2023
1 parent 7d436a9 commit 42c86e8
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

1 comment on commit 42c86e8

@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 42c86e8.
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/5154011114
📝 Reported issues:

Please sign in to comment.