[wp-trac] [WordPress Trac] #54954: --wp--preset-- variables defaults not being updated by add_theme_support() 'editor-font-sizes' or 'editor-color-palette'

WordPress Trac noreply at wordpress.org
Thu Jan 27 14:57:12 UTC 2022


#54954: --wp--preset-- variables defaults not being updated by add_theme_support()
'editor-font-sizes' or 'editor-color-palette'
--------------------------+-----------------------------
 Reporter:  tommusrhodus  |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:  5.9
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 Having an issue updating the default values for preset variables, such as
 font size {{{large}}}, or color {{{black}}}

 Since 5.9 it appears that fonts and colours defined in theme.json will
 correctly override the default values of --wp--preset-- variables, however
 those defined via add_theme_support are not, and so the default values are
 still being used.

 This is being triggered by whether or not a theme calls
 {{{add_theme_support( 'experimental-link-color' )}}}

 A simple way to test what's going on here:

 1. Open a blank install with the Twenty-Twenty-One theme installed.
 2. Create a new page and add paragraph text with the font size set to
 {{{large}}} and set the background color to {{{black}}}
 3. Open {{{functions.php}}} and edit {{{line 170}}} to change the
 {{{large}}} font size, and then edit {{{line 203}}} to change the black
 color and save.

 Result: Paragraph text correctly reflects changes made to font size and
 color.

 4. Open functions.php and delete {{{line 333: add_theme_support(
 'experimental-link-color' );}}}

 Result: Font size and color fallback to WP default values.

 Expected behaviour: Font sizes and colors set via {{{add_theme_support}}}
 should continue to work as pre 5.9 without the need to add
 {{{add_theme_support( 'experimental-link-color' );}}}

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


More information about the wp-trac mailing list