Make WordPress Core

Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#54158 closed defect (bug) (invalid)

Themes should be updated to use add_editor_style

Reported by: gwwar's profile gwwar Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Bundled Theme Keywords:
Focuses: Cc:


twentyten, twentyeleven, twentytwelve, twentythirteen, twentyfourteen, twentyfifteen, twentysixteen, twentyseventeen, and twentytwenty should be updated to enqueue editor styles using add_editor_style instead of wp_enqueue_style

In the block editor, with the sidebar open if we insert a block that has a styles panel (like an image, social links or site logo) a JS error is thrown: "Stylesheet ... was not not properly added"

Change History (5)

#1 @joyously
3 years ago

It is not the themes that need to update.
The block editor should be updated to work with the thousands of existing themes that do it the old way.

#2 @sabernhardt
3 years ago

  • Component changed from Themes to Bundled Theme

Is it an order issue instead of a wp_enqueue_style problem?

The how-to guide says that "you first need to add_theme_support" when including add_editor_style('editor-styles'). Only Twenty Nineteen and Twenty Twenty-One have add_theme_support before add_editor_style.

#3 @gwwar
3 years ago

@ellatrix @youknowriad any thoughts here? We can reopen if no theme updates are needed.

#4 @gwwar
3 years ago

  • Resolution set to invalid
  • Status changed from new to closed

Thanks y'all for taking a look.

So I was able to chat with folks and it looks like this behavior is expected. The console error is meant to be a warning or upgrade path. Let's close out this issue out and I can modify to update that console.error to a console.warn.

#5 @SergeyBiryukov
3 years ago

  • Milestone Awaiting Review deleted

Thanks for the follow-up!

Note: See TracTickets for help on using tickets.