Changeset 55368
- Timestamp:
- 02/20/2023 09:11:57 PM (2 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/site-editor.php
r55338 r55368 121 121 122 122 if ( 123 current_theme_supports( 'wp-block-styles' ) ||123 current_theme_supports( 'wp-block-styles' ) && 124 124 ( ! is_array( $editor_styles ) || count( $editor_styles ) === 0 ) 125 125 ) { -
trunk/src/wp-includes/block-editor.php
r55192 r55368 297 297 */ 298 298 function _wp_get_iframed_editor_assets() { 299 global $pagenow ;299 global $pagenow, $editor_styles; 300 300 301 301 $script_handles = array( … … 306 306 ); 307 307 308 if ( current_theme_supports( 'wp-block-styles' ) ) { 308 if ( 309 current_theme_supports( 'wp-block-styles' ) && 310 ( ! is_array( $editor_styles ) || count( $editor_styles ) === 0 ) 311 ) { 309 312 $style_handles[] = 'wp-block-library-theme'; 310 313 } -
trunk/src/wp-includes/script-loader.php
r55314 r55368 1636 1636 } 1637 1637 1638 if ( ! is_array( $editor_styles ) || count( $editor_styles ) === 0 ) { 1639 // Include opinionated block styles if no $editor_styles are declared, so the editor never appears broken. 1638 if ( 1639 current_theme_supports( 'wp-block-styles' ) && 1640 ( ! is_array( $editor_styles ) || count( $editor_styles ) === 0 ) 1641 ) { 1642 /* 1643 * Include opinionated block styles if the theme supports block styles and 1644 * no $editor_styles are declared, so the editor never appears broken. 1645 */ 1640 1646 $wp_edit_blocks_dependencies[] = 'wp-block-library-theme'; 1641 1647 } -
trunk/tests/phpunit/tests/dependencies/styles.php
r54348 r55368 406 406 407 407 /** 408 * Tests that visual block styles are enqueued in the editor evenwhen there is not theme support for 'wp-block-styles'.409 * 410 * Visual block styles should always be enqueued when editing to avoid the appearance of a broken editor.408 * Tests that visual block styles are not be enqueued in the editor when there is not theme support for 'wp-block-styles'. 409 * 410 * @ticket 57561 411 411 * 412 412 * @covers ::wp_enqueue_style … … 420 420 $this->assertFalse( wp_style_is( 'wp-block-library-theme' ) ); 421 421 wp_enqueue_style( 'wp-edit-blocks' ); 422 $this->assert True( wp_style_is( 'wp-block-library-theme' ));422 $this->assertFalse( wp_style_is( 'wp-block-library-theme' ), "The 'wp-block-library-theme' style should not be in the queue after enqueuing 'wp-edit-blocks'" ); 423 423 } 424 424
Note: See TracChangeset
for help on using the changeset viewer.