Opened 4 months ago
Last modified 5 weeks ago
#60826 new defect (bug)
Fix incorrect use of add_theme_support( 'editor-style(s)' )
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | 6.7 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Themes | Keywords: | has-patch reporter-feedback dev-feedback |
Focuses: | Cc: |
Description
In the functions add_editor_style()
, remove_editor_styles()
and remove_theme_support()
the Theme $feature
parametereditor-style
is used instead of editor-styles
.
It should be: add_theme_support( 'editor-styles' );
See docs: https://developer.wordpress.org/block-editor/how-to-guides/themes/theme-support/#editor-styles
See code docs: https://github.com/WordPress/wordpress-develop/blob/8d0aed455b1790c5d51386f7675d9e8d68e48edf/src/wp-includes/theme.php#L2672
Change History (10)
This ticket was mentioned in PR #6308 on WordPress/wordpress-develop by @Soean.
4 months ago
#1
- Keywords has-patch added
@audrasjb commented on PR #6308:
4 months ago
#2
This will require a Unit test update, too.
#3
@
4 months ago
Introduced in https://core.trac.wordpress.org/ticket/14903
#7
@
7 weeks ago
I wonder if this can possibly break something for people who used 'editor-style' because it is used in the core? 🤔
add_editor_style() function declaring support for 'editor-style' and I found this confusing, so I added "add_theme_support( 'editor-styles' )" before add_editor_style() in theme I am working on (classic approach works for me better).
I also wonder if test should count on different state for classic and block themes, because for block themes, 'editor-styles' declared by default.
I think, the patch needs rebase.
This ticket was mentioned in Slack in #core by oglekler. View the logs.
5 weeks ago
#9
@
5 weeks ago
- Keywords reporter-feedback dev-feedback added
Is the block editor using these functions?
These functions are intended and are documented for the TinyMCE (see [13441] and [16721]).
For example, add_editor_style()
is documented as:
Adds callback for custom TinyMCE editor stylesheets.
I'm curious what the impact might be of changing these instances and if any shims might be needed for older and non-block themes using them.
Trac ticket: https://core.trac.wordpress.org/ticket/60826