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

Process settings only once in edit-site #26330

Merged
merged 6 commits into from
Oct 22, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
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
5 changes: 0 additions & 5 deletions lib/edit-site-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Copy link
Member Author

@oandregal oandregal Oct 20, 2020

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.

// Example: Global Styles.
global $post;
$settings = apply_filters( 'block_editor_settings', $settings, $post );

// Preload block editor paths.
// most of these are copied from edit-forms-blocks.php.
$preload_paths = array(
Expand Down
3 changes: 2 additions & 1 deletion lib/global-styles.php
Original file line number Diff line number Diff line change
Expand Up @@ -975,5 +975,6 @@ function gutenberg_experimental_global_styles_register_cpt() {
}

add_action( 'init', 'gutenberg_experimental_global_styles_register_cpt' );
add_filter( 'block_editor_settings', 'gutenberg_experimental_global_styles_settings' );
add_action( 'wp_enqueue_scripts', 'gutenberg_experimental_global_styles_enqueue_assets' );
// This is to hook into the edit-post (block-editor store)
oandregal marked this conversation as resolved.
Show resolved Hide resolved
add_filter( 'block_editor_settings', 'gutenberg_experimental_global_styles_settings' );