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

Try: make logic for conditional editor_styles consistent #45351

Closed
wants to merge 12 commits into from
2 changes: 1 addition & 1 deletion lib/compat/wordpress-6.1/template-parts-screen.php
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ static function( $classes ) {
wp_enqueue_media();

if (
current_theme_supports( 'wp-block-styles' ) ||
current_theme_supports( 'wp-block-styles' ) &&
mikachan marked this conversation as resolved.
Show resolved Hide resolved
Copy link
Member Author

Choose a reason for hiding this comment

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

This needs to be updated in Core in wp-admin/site-editor.php.

( ! is_array( $editor_styles ) || count( $editor_styles ) === 0 )
) {
wp_enqueue_style( 'wp-block-library-theme' );
Expand Down
7 changes: 5 additions & 2 deletions lib/compat/wordpress-6.2/script-loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ static function () use ( $style ) {
* Note for core merge: see inline comment on what's been updated.
*/
function gutenberg_resolve_assets_override() {
global $pagenow;
global $pagenow, $editor_styles;

$script_handles = array(
'wp-polyfill',
Expand All @@ -80,7 +80,10 @@ function gutenberg_resolve_assets_override() {
'wp-edit-blocks',
);

if ( current_theme_supports( 'wp-block-styles' ) ) {
if (
current_theme_supports( 'wp-block-styles' ) &&
( ! is_array( $editor_styles ) || count( $editor_styles ) === 0 )
) {
Comment on lines +83 to +86
Copy link
Member Author

Choose a reason for hiding this comment

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

This needs to be updated in Core in wp-includes/script-loader.php.

$style_handles[] = 'wp-block-library-theme';
}

Expand Down