[wp-trac] [WordPress Trac] #51755: editor-styles theme feature naming with or without trailing s

WordPress Trac noreply at wordpress.org
Wed Nov 11 18:00:58 UTC 2020


#51755: editor-styles theme feature naming with or without trailing s
--------------------------+-----------------------------
 Reporter:  mmems         |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Themes        |    Version:  5.5.2
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 I tried in vain to follow the documentation about
 [https://codex.wordpress.org/Editor_Style editor styles]:

   There is no need to explicitly
 [https://codex.wordpress.org/Function_Reference/add_theme_support add
 theme support] for this feature since support is added automatically when
 calling:
   {{{#!php
   add_editor_style();
   }}}

 But I can't make it work.

 The only way to do it is to use both functions:
 {{{#!php
 // in after_setup_theme action:
 add_theme_support( 'editor-styles' ); // without that call, the editor-
 style.css
 add_editor_style();
 }}}


 After tried all combinations, I found that the function
 [https://core.trac.wordpress.org/browser/tags/5.5.3/src/wp-
 includes/theme.php#L2037 add_editor_style],
 [https://core.trac.wordpress.org/browser/tags/5.5.3/src/wp-
 includes/theme.php#L2062 remove_editor_styles] and
 [https://core.trac.wordpress.org/browser/tags/5.5.3/src/wp-
 includes/theme.php#L2843 remove_theme_support] use the theme feature name
 `editor-style` (without the trailing `s`) where the feature is called
 `editor-styles` in [https://core.trac.wordpress.org/browser/tags/5.5.3/src
 /wp-includes/theme.php#L3951 wp-includes/theme.php].
 Note the default file name used in
 [https://core.trac.wordpress.org/browser/tags/5.5.3/src/wp-
 includes/theme.php#L2037 add_editor_style] is `editor-style.css` (filename
 without `s`)

 Note also that, this name also used (without `s`) in
 [https://core.trac.wordpress.org/browser/tags/5.5.3/src/wp-
 admin/includes/theme.php#L310 wp-admin/includes/theme.php].

 Also it exist an [https://developer.wordpress.org/block-
 editor/developers/themes/theme-support/#dark-backgrounds other theme
 feature] called `dark-editor-style` (without `s`) which is related to
 `editor-styles` theme feature.

 There is a ways to simplify that, like using the name `editor-style`, and
 `editor-styles` as an alias (or vice versa)?
 To be consistant, use (with or) without the trailing `s` everywhere?

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/51755>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list