-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Process settings only once in edit-site #26330
Conversation
@@ -137,11 +137,6 @@ function gutenberg_edit_site_init( $hook ) { | |||
$settings['styles'] = gutenberg_get_editor_styles(); | |||
$settings = gutenberg_experimental_global_styles_settings( $settings ); | |||
|
|||
// This is so other parts of the code can hook their own settings. |
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.
Note how in the line above this code we call gutenberg_experimental_global_styles_settings
.
Size Change: +15 B (0%) Total Size: 1.2 MB
ℹ️ View Unchanged
|
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 helping with my comments, but block_editor_settings
filter is something that gets a bit confusing with other pages that Edit Post using the block editor.
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.
Code makes sense, how can I test it?
@gziolo By making sure the edit-site store still has the settings it needs: |
I can confirm that all those experimental settings are exposed only once in the source code of HTML document and it's propagated correctly to the block editor store :) |
We are processing Global Styles twice in the edit-site screen. This PR removes the duplication and follows the same standards as in the other screens, this is, use
gutenberg_experimental_global_styles_settings
to get the settings instead of hooking into theblock_editor_setting
filter.