Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Editor: Unify right click override preference #57468

Merged
merged 5 commits into from
Jan 3, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,19 @@ export default function convertEditorSettings( data ) {
};
delete newData[ 'core/edit-post' ][ setting ];
}

if ( data?.[ 'core/edit-post' ]?.[ setting ] !== undefined ) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should it be 'core/edit-site' here?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Though potentially the preference for the site editor can be deleted at the same time as the data for the post editor (after line 18) given it's being disregarded and no longer used for anything.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops, right, I'll fix it in one of the other PRs

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It can't be on line 18 though because it might exist while the post editor one won't.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix included here 429a995

delete newData[ 'core/edit-site' ][ setting ];
}
} );

if ( Object.keys( newData?.[ 'core/edit-post' ] ?? {} )?.length === 0 ) {
delete newData[ 'core/edit-post' ];
}

if ( Object.keys( newData?.[ 'core/edit-site' ] ?? {} )?.length === 0 ) {
delete newData[ 'core/edit-site' ];
}

return newData;
}
Loading