Skip to content

Commit

Permalink
Remove $editor_styles check
Browse files Browse the repository at this point in the history
  • Loading branch information
mikachan committed Dec 16, 2022
1 parent 0939f34 commit b3b368b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 9 deletions.
2 changes: 1 addition & 1 deletion lib/client-assets.php
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ function gutenberg_register_packages_styles( $styles ) {
}

global $editor_styles;
if ( current_theme_supports( 'wp-block-styles' ) && ( ! is_array( $editor_styles ) || count( $editor_styles ) === 0 ) ) {
if ( current_theme_supports( 'wp-block-styles' ) ) {
// Include opinionated block styles if the theme supports block styles and no $editor_styles are declared, so the editor never appears broken.
$wp_edit_blocks_dependencies[] = 'wp-block-library-theme';
}
Expand Down
5 changes: 1 addition & 4 deletions lib/compat/wordpress-6.1/template-parts-screen.php
Original file line number Diff line number Diff line change
Expand Up @@ -177,10 +177,7 @@ static function( $classes ) {
wp_enqueue_style( 'wp-format-library' );
wp_enqueue_media();

if (
current_theme_supports( 'wp-block-styles' ) &&
( ! is_array( $editor_styles ) || count( $editor_styles ) === 0 )
) {
if ( current_theme_supports( 'wp-block-styles' ) ) {
wp_enqueue_style( 'wp-block-library-theme' );
}

Expand Down
5 changes: 1 addition & 4 deletions lib/compat/wordpress-6.2/script-loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,7 @@ function gutenberg_resolve_assets_override() {
'wp-edit-blocks',
);

if (
current_theme_supports( 'wp-block-styles' ) &&
( ! is_array( $editor_styles ) || count( $editor_styles ) === 0 )
) {
if ( current_theme_supports( 'wp-block-styles' ) ) {
$style_handles[] = 'wp-block-library-theme';
}

Expand Down

1 comment on commit b3b368b

@github-actions
Copy link

Choose a reason for hiding this comment

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

Flaky tests detected.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/3715218027
📝 Reported issues:

Please sign in to comment.