Skip to content

Commit

Permalink
add core settings to the start of the array so themes can override them
Browse files Browse the repository at this point in the history
  • Loading branch information
scruffian committed Oct 18, 2022
1 parent 6a3b2e7 commit 9fad82e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/compat/wordpress-6.1/script-loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,13 +146,15 @@ function gutenberg_add_editor_classic_theme_styles( $editor_settings ) {
// This follows the pattern of get_block_editor_theme_styles,
// but we can't use get_block_editor_theme_styles directly as it
// only handles external files or theme files.
$editor_settings['styles'][] = array(
$classic_theme_styles_settings = array(
'css' => file_get_contents( $classic_theme_styles ),
'baseURL' => get_theme_file_uri( $classic_theme_styles ),
'__unstableType' => 'theme',
'__unstableType' => 'core',
'isGlobalStyles' => false,
);

// Add these settings to the start of the array so that themes can override them.
array_unshift( $editor_settings['styles'], $classic_theme_styles_settings );

return $editor_settings;
}
add_filter( 'block_editor_settings_all', 'gutenberg_add_editor_classic_theme_styles' );

0 comments on commit 9fad82e

Please sign in to comment.