Skip to content

Commit

Permalink
Fix e2e test: add theme and edit-site styles correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
ellatrix committed Apr 26, 2023
1 parent 083f79f commit 9f66f6a
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions lib/compat/wordpress-6.3/script-loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
* }
*/
function _gutenberg_get_iframed_editor_assets() {
global $wp_styles, $wp_scripts;
global $wp_styles, $wp_scripts, $pagenow;

// Keep track of the styles and scripts instance to restore later.
$current_wp_styles = $wp_styles;
Expand All @@ -45,8 +45,17 @@ function _gutenberg_get_iframed_editor_assets() {
// We do not need reset styles for the iframed editor.
$wp_styles->done = array( 'wp-reset-editor-styles' );

wp_enqueue_style( 'wp-edit-blocks' );
wp_enqueue_script( 'wp-polyfill' );
// Enqueue the `editorStyle` handles for all core block, and dependencies.
wp_enqueue_style( 'wp-edit-blocks' );

if ( 'site-editor.php' === $pagenow ) {
wp_enqueue_style( 'wp-edit-site' );
}

if ( current_theme_supports( 'wp-block-styles' ) ) {
wp_enqueue_style( 'wp-block-library-theme' );
}

// We don't want to load EDITOR scripts in the iframe, only enqueue
// front-end assets for the content.
Expand Down

0 comments on commit 9f66f6a

Please sign in to comment.