Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion lib/full-site-editing/edit-site-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ function gutenberg_get_editor_styles() {
* @param string $hook Page.
*/
function gutenberg_edit_site_init( $hook ) {
global $current_screen, $post;
global $current_screen, $post, $editor_styles;

if ( ! gutenberg_is_edit_site_page( $hook ) ) {
return;
Expand Down Expand Up @@ -170,6 +170,14 @@ function gutenberg_edit_site_init( $hook ) {
wp_enqueue_script( 'wp-format-library' );
wp_enqueue_style( 'wp-edit-site' );
wp_enqueue_style( 'wp-format-library' );

if (
current_theme_supports( 'wp-block-styles' ) ||
Copy link
Contributor

Choose a reason for hiding this comment

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

We have this same condition for loading the styles in the post editor. I wonder if we should refactor that to share the code?

Copy link
Contributor

Choose a reason for hiding this comment

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

If we do refactor this I see a function in WP_Theme_Config being introduce here #29667

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

}
add_action( 'admin_enqueue_scripts', 'gutenberg_edit_site_init' );

Expand Down