Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Remove usage of get_default_block_editor_settings #46112
Remove usage of get_default_block_editor_settings #46112
Changes from 6 commits
9e82a0b
b0a9764
2e646a7
999b258
4d1a053
0e7894a
725db89
0f3c45b
c978b88
90cc1ce
f595fba
fcc46b2
0a2fcfd
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should also be ok to have two functions in core:
get_default_block_editor_settings
and the very specificget_legacy_theme_supports_for_theme_json
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you consider a name such as
gutenberg_get_legacy_theme_supports_for_theme_json
? Or something along that vein. It's more in line with what this code is used for. The current naming may imply that it returns all theme supports, and may mislead people.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Orignally was in experimental, but it would mean, that this code would do nothing in the plugin - 999b258
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure I follow. Perhaps you meant to comment on this other thread? https://github.com/WordPress/gutenberg/pull/46112/files#r1037282457
If so, how does it do nothing if this code stays in
lib/experimental
? The whole Gutenberg uses the classWP_Theme_JSON_Resolver_Gutenberg
defined in this file.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at the code that uses this data (I didn't find a more recent definition of this code in Gutenberg), we need:
disableCustomColors
disableCustomGradients
disableCustomFontSizes
enableCustomLineHeight
enableCustomUnits
enableCustomSpacing
It seems we can get rid of
disableLayoutStyles
in this method?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's something in this file that still needs to live in the experimental folder: the call to
gutenberg_add_registered_webfonts_to_theme_json
.This is in my list of things to look at to give it some clarity and improve the developer experience. Given that the change required here is a one-liner (
get_default_block_editor_settings
togutenberg_get_block_theme_supports
) and we need to look at this separately, would you mind making your changes in this file directly instead of moving it to 6.2?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clarified in this slack thread.