Commit aa08aa17b5 for wordpress.org
commit aa08aa17b560bd06d6a947ac4e6f3f6d174eb481
Author: peterwilsoncc <peterwilsoncc@git.wordpress.org>
Date: Tue Nov 24 01:13:54 2026 +0000
Editor: Restore the default block editor styles.
Moves the default block editor styles into `get_default_block_editor_settings()` rather than attempting to read them from `wp-includes/css/dist/block-editor/default-editor-styles.css`.
The file's source was removed from the block editor package in https://github.com/WordPress/gutenberg/commit/aee1d484423d020fd6b4857abdae29b01c079530, so the `defaultEditorStyles` setting was empty and the styles were missing in these places:
* The block editor, when a user turns off the theme styles preference.
* The Customizer's widgets editor.
The file's post title rule is not restored. The `.editor-post-title__block` class it targets was removed in WordPress 5.9.
The tests are updated to ensure the default editor styles are populated.
Developed in: https://github.com/WordPress/wordpress-develop/pull/16118
Follow-up to r63535.
Reviewed by wildworks.
Props mukesh27, wildworks.
Fixes #66762.
Built from https://develop.svn.wordpress.org/trunk@65749
git-svn-id: http://core.svn.wordpress.org/trunk@64779 1a063a9b-81f0-0310-95a4-ce76da25c4cd
diff --git a/wp-includes/block-editor.php b/wp-includes/block-editor.php
index 24bdd2f6db..8aa19ffe35 100644
--- a/wp-includes/block-editor.php
+++ b/wp-includes/block-editor.php
@@ -194,21 +194,18 @@ function get_default_block_editor_settings() {
}
}
- // These styles are used if the "no theme styles" options is triggered or on
- // themes without their own editor styles.
- $default_editor_styles_file = ABSPATH . WPINC . '/css/dist/block-editor/default-editor-styles.css';
-
- static $default_editor_styles_file_contents = false;
- if ( ! $default_editor_styles_file_contents && file_exists( $default_editor_styles_file ) ) {
- $default_editor_styles_file_contents = file_get_contents( $default_editor_styles_file );
- }
-
- $default_editor_styles = array();
- if ( $default_editor_styles_file_contents ) {
- $default_editor_styles = array(
- array( 'css' => $default_editor_styles_file_contents ),
- );
- }
+ /*
+ * These styles are used when the "Use theme styles" preference is turned off
+ * and in the Customizer widgets editor.
+ *
+ * They were previously read from `css/dist/block-editor/default-editor-styles.css`,
+ * which the block editor package no longer ships.
+ */
+ $default_editor_styles = array(
+ array(
+ 'css' => 'body{font-family:-apple-system,system-ui,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;font-size:18px;line-height:1.5;--wp--style--block-gap:2em}p{line-height:1.8}',
+ ),
+ );
$editor_settings = array(
'alignWide' => get_theme_support( 'align-wide' ),
diff --git a/wp-includes/version.php b/wp-includes/version.php
index 9f3d3443ad..a0feae7735 100644
--- a/wp-includes/version.php
+++ b/wp-includes/version.php
@@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
-$wp_version = '7.2-RC2-65748';
+$wp_version = '7.2-RC2-65749';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.