Make WordPress Core

Opened 4 years ago

Closed 4 years ago

Last modified 4 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:

Description

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"

https://user-images.githubusercontent.com/1270189/134224724-d44aa9aa-53a0-4303-9010-cc556ae327fd.png

https://user-images.githubusercontent.com/1270189/134224669-dc52f333-74cc-4599-9c93-e30827e7cf22.mp4

Change History (5)

#1 @joyously
4 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
4 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
4 years ago

@ellatrix @youknowriad any thoughts here? We can reopen https://github.com/WordPress/gutenberg/issues/35018 if no theme updates are needed.

#4 @gwwar
4 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 https://github.com/WordPress/gutenberg/issues/35018 to update that console.error to a console.warn.

#5 @SergeyBiryukov
4 years ago

  • Milestone Awaiting Review deleted

Thanks for the follow-up!

Note: See TracTickets for help on using tickets.