Skip to content

Commit

Permalink
Editor: Fix post visibility null password edits. (#17210)
Browse files Browse the repository at this point in the history
  • Loading branch information
epiqueras committed Aug 27, 2019
1 parent 5973603 commit a6e85e6
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/editor/src/components/post-visibility/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,12 @@ export default compose( [
const { savePost, editPost } = dispatch( 'core/editor' );
return {
onSave: savePost,
onUpdateVisibility( status, password = null ) {
editPost( { status, password } );
onUpdateVisibility( status, password ) {
const edits = { status };
if ( password !== undefined ) {
edits.password = password;
}
editPost( edits );
},
};
} ),
Expand Down

0 comments on commit a6e85e6

Please sign in to comment.