updates – add_editor_style not working after upgrade to WP v 6.2
I had a site I was running with a block-based/FSE theme on WP v.6.1.1. In functions.php
, I was loading my theme stylesheet in the Gutenberg editor using the following:
function dnl_theme_add_editor_styles() {
add_editor_style();
}
add_action( 'after_setup_theme', 'dnl_theme_add_editor_styles' );
This worked perfectly well (editor-style.css
loaded in Gutenberg) until I upgraded to WordPress 6.2. After that, the stylesheet stopped getting loaded in the editor. I tried loading style.css
using add_editor_style
like so:
function dnl_theme_add_editor_styles() {
add_editor_style( 'style.css' );
}
I also tried calling add_theme_support
first, e.g.:
function dnl_theme_add_editor_styles() {
add_theme_support( 'wp-block-styles' );
add_editor_style();
}
But none of that helped.
Has anyone else noticed this behavior after upgrading? Does anyone know why this would be happening? I looked at the source code for add_editor_style
in wp-includes/theme.php
and didn’t see any changes there since 6.1.1.
Leave an answer